Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 720806

Summary: net-misc/dhcp fails to compile
Product: Gentoo Linux Reporter: Agostino Sarubbo <ago>
Component: Current packagesAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: normal CC: allenwebb, deb01, Gentoo, sam
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: PPC   
OS: Linux   
URL: https://gitlab.isc.org/isc-projects/dhcp/-/issues/89
See Also: https://bugs.gentoo.org/show_bug.cgi?id=668002
https://bugs.gentoo.org/show_bug.cgi?id=719662
https://bugs.gentoo.org/show_bug.cgi?id=801592
https://bugs.gentoo.org/show_bug.cgi?id=857804
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 721344, 720694    
Attachments: build.log
build.log (arm)
20201228-dhcp-4.4.2-r3-missing-atomic-lib.patch
build log
build failure log

Description Agostino Sarubbo gentoo-dev 2020-05-03 12:23:54 UTC
This is an auto-filled bug because net-misc/dhcp fails to compile.
The issue was originally discovered on ppc, but it may be reproducible on other arches as well.
If you think that a different summary clarifies the issue better, feel free to change it.
Attached build log and emerge --info.
Comment 1 Agostino Sarubbo gentoo-dev 2020-05-03 12:24:02 UTC
Created attachment 635836 [details]
build.log

build log and emerge --info
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-05-03 12:26:20 UTC
This looks very similar to some other bugs we've seen on ppc. The fix is to link against -latomic.
Comment 3 Thomas Deutschmann (RETIRED) gentoo-dev 2020-05-03 13:30:59 UTC
Please confirm if you can reproduce with net-misc/dhcp-4.4.1.
Comment 4 Agostino Sarubbo gentoo-dev 2020-05-04 14:28:33 UTC
4.4.1 works for me
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-05-07 12:50:54 UTC
Created attachment 636720 [details]
build.log (arm)

I've just hit the same on arm.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-05-07 12:51:47 UTC
Comment on attachment 636720 [details]
build.log (arm)

Portage 2.3.89 (python 3.6.10-final-0, default/linux/arm/17.0/armv6j, gcc-9.3.0, glibc-2.30-r8, 4.19.113-v7+ armv7l)
=================================================================
System uname: Linux-4.19.113-v7+-armv7l-ARMv7_Processor_rev_5_-v7l-with-gentoo-2.6
KiB Mem:      948244 total,     19660 free
KiB Swap:    4194300 total,   3943384 free
Timestamp of repository gentoo: Thu, 07 May 2020 10:05:29 +0000
sh bash 4.4_p23-r1
ld GNU ld (Gentoo 2.32 p2) 2.32.0
distcc 3.3.3 armv6j-unknown-linux-gnueabihf [enabled]
app-shells/bash:          4.4_p23-r1::gentoo
dev-lang/perl:            5.30.1::gentoo
dev-lang/python:          2.7.18::gentoo, 3.6.10-r2::gentoo, 3.7.7-r2::gentoo, 3.8.2-r2::gentoo
dev-util/cmake:           3.16.5::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.42.1::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.69-r4::gentoo
sys-devel/automake:       1.13.4-r2::gentoo, 1.15.1-r2::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.30-r2::gentoo, 2.32-r1::gentoo, 2.33.1-r1::gentoo
sys-devel/gcc:            9.2.0-r2::gentoo, 9.3.0::gentoo
sys-devel/gcc-config:     2.2.1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.4::gentoo (virtual/os-headers)
sys-libs/glibc:           2.30-r8::gentoo
Repositories:

gentoo
    location: /bound/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts:
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: yes

ACCEPT_KEYWORDS="arm"
ACCEPT_LICENSE="@FREE"
CBUILD="armv6j-unknown-linux-gnueabihf"
CFLAGS="-O2 -pipe -march=armv6j -mfpu=vfp -mfloat-abi=hard -fdiagnostics-show-option -frecord-gcc-switches"
CHOST="armv6j-unknown-linux-gnueabihf"
CONFIG_PROTECT="/boot/cmdline.txt /boot/config.txt /etc /etc/grs/systems.conf /usr/share/gnupg/qualified.txt /var/qmail/alias /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.4/ext-active/ /etc/php/cgi-php7.4/ext-active/ /etc/php/cli-php7.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=armv6j -mfpu=vfp -mfloat-abi=hard"
DISTDIR="/bound/distfiles"
EMERGE_DEFAULT_OPTS="--keep-going"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe -march=armv6j -mfpu=vfp -mfloat-abi=hard"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distcc distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch parallel-install preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe -march=armv6j -mfpu=vfp -mfloat-abi=hard"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
INSTALL_MASK="/usr/share/doc/*/*.pdf /usr/share/man/*/*"
LANG="en_GB.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
LINGUAS="en en_GB"
MAKEOPTS="-j10 -l10"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="acl arm berkdb bzip2 cli crypt dri fortran gdbm iconv ipv6 ncurses nls nptl openmp pam pcre readline seccomp split-usr ssl tcpd unicode xattr zlib" ADA_TARGET="gnat_2018" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_ARM="edsp thumb v4 v5 v6" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en en-GB" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python2_7 python3_7" RUBY_TARGETS="ruby24 ruby25" USERLAND="GNU" VIDEO_CARDS="exynos fbdev omap dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-06-26 21:32:26 UTC
*** Bug 729774 has been marked as a duplicate of this bug. ***
Comment 8 Chuckery Towers 2020-12-26 20:16:31 UTC
This is my first ever proposed bug fix, so please be gentle with me if I have made a mistake.

In my circumstances, this appeared to work:-

/etc/portage/patches/net-misc/dhcp-4.4.2-r3/dhcp-4.4.2-r3-missing-library-720806.patch
============

---%<---
# Gentoo Bug 720806 - net-misc/dhcp fails to compile 
# https://bugs.gentoo.org/720806

# Compilation may fail because "-latomic" is not specified where necessary
# Applies to "net-misc/dhcp-4.4.2-r3" and possibly others
# This patch by Graham Bosworth, graham@ChuckeryTowers.plus.com, 2020-12-26

# The necessary clue came from the second comment in the bug history,
# https://bugs.gentoo.org/720806#c2


--- ./omapip/Makefile.in
+++ ./omapip/Makefile.in
274c274
< LIBS = @LIBS@
---
> LIBS =        @LIBS@  -latomic


--- ./client/Makefile.in
+++ ./client/Makefile.in
293c293
< LIBS = @LIBS@
---
> LIBS =        @LIBS@  -latomic


--- ./dhcpctl/Makefile.in
+++ ./dhcpctl/Makefile.in
271c271
< LIBS = @LIBS@
---
> LIBS =        @LIBS@  -latomic


--- ./relay/Makefile.in
+++ ./relay/Makefile.in
285c285
< LIBS = @LIBS@
---
> LIBS =        @LIBS@  -latomic


--- ./server/Makefile.in
+++ ./server/Makefile.in
319c319
< LIBS = @LIBS@
---
> LIBS =        @LIBS@  -latomic


--->%---
Comment 9 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2020-12-28 19:23:16 UTC
Created attachment 680101 [details, diff]
20201228-dhcp-4.4.2-r3-missing-atomic-lib.patch
Comment 10 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2020-12-28 19:25:33 UTC
@Chuckery Towers, @Sam:
Can you please test my alternate patch on your systems? Just apply to the ebuild and see if it then builds for you.

Generally with autoconf you don't need to patch Makefiles like you're doing, because it provides build-time means to inject the values.

What I'm not sure about, is this bundles BIND9 and uses parts for building, and the failure was inside BIND9's build, not in the plain dhcp portion.
Comment 11 Chuckery Towers 2020-12-29 20:06:39 UTC
Created attachment 680218 [details]
build log

Build failure with /etc/portage/patches/...
Comment 12 Chuckery Towers 2020-12-29 20:08:23 UTC
Created attachment 680221 [details]
build failure log

Building failed again with the proposed patch in another location.
Comment 13 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2020-12-29 20:09:14 UTC
(In reply to Chuckery Towers from comment #11)
> Created attachment 680218 [details]
> build log
> 
> Build failure with /etc/portage/patches/...

You need to apply my patch to the ebuild directly, not dump it in /etc/portage/patches.

patch -p1 /usr/portage/net-misc/dhcp/dhcp-4.4.2-r3.ebuild <.../20201228-dhcp-4.4.2-r3-missing-atomic-lib.patch
Comment 14 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-02-25 00:12:19 UTC
(In reply to Robin Johnson from comment #10)
> @Chuckery Towers, @Sam:
> Can you please test my alternate patch on your systems? Just apply to the
> ebuild and see if it then builds for you.
> 
> Generally with autoconf you don't need to patch Makefiles like you're doing,
> because it provides build-time means to inject the values.
> 
> What I'm not sure about, is this bundles BIND9 and uses parts for building,
> and the failure was inside BIND9's build, not in the plain dhcp portion.

Sorry, I missed this until now -- works!
Comment 15 Larry the Git Cow gentoo-dev 2021-02-25 01:28:33 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=af7f9e4e6383822de9d5b9c4f462041927cfc83f

commit af7f9e4e6383822de9d5b9c4f462041927cfc83f
Author:     Robin H. Johnson <robbat2@gentoo.org>
AuthorDate: 2021-02-25 01:27:40 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-02-25 01:27:40 +0000

    net-misc/dhcp: fix 32-bit build with libatomic (ppc, arm, ...)
    
    Bug: https://bugs.gentoo.org/720806
    Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
    Signed-off-by: Sam James <sam@gentoo.org>

 net-misc/dhcp/dhcp-4.4.2-r3.ebuild | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
Comment 16 Allen Webb 2023-01-27 15:10:50 UTC
This breaks compilation with clang:
```
configure:4312: checking whether the C compiler works
configure:4334: armv7a-cros-linux-gnueabihf-clang  -Os -pipe  -march=armv7-a -mtune=cortex-a15 -mfpu=neon -mfloat-abi=hard -g -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -ffunction-sections -fdata-sections -fno-strict-aliasing  -Wl,-O2 -Wl,--as-needed  -Wl,--gc-sections -Wl,--icf=all conftest.c  -latomic >&5
ld.lld: error: unable to find library -latomic
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
```
Comment 17 Mike Gilbert gentoo-dev 2023-01-28 19:41:09 UTC
(In reply to Allen Webb from comment #16)

File a new bug please. Nobody will pay attention to a bug that was marked fixed 2 years ago.
Comment 18 Larry the Git Cow gentoo-dev 2023-07-14 12:09:09 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=885a699283e2efc97faa78f694f04811d8d1123a

commit 885a699283e2efc97faa78f694f04811d8d1123a
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-07-14 12:08:28 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-07-14 12:08:28 +0000

    net-misc/dhcp: switch to append-atomic-flags
    
    Fixes build on mips (report on #gentoo).
    
    Bug: https://bugs.gentoo.org/720806
    Bug: https://bugs.gentoo.org/801592
    Signed-off-by: Sam James <sam@gentoo.org>

 net-misc/dhcp/dhcp-4.4.3_p1-r4.ebuild | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)