Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 883945 - net-analyzer/net-snmp-5.9.3-r1 fails to compile with -Os (.libs/snmpps.o: undefined reference to symbol 'halfdelay')
Summary: net-analyzer/net-snmp-5.9.3-r1 fails to compile with -Os (.libs/snmpps.o: und...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: tinfo
  Show dependency tree
 
Reported: 2022-12-02 01:47 UTC by Quinn Jones
Modified: 2022-12-03 02:43 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,344.81 KB, text/plain)
2022-12-02 01:47 UTC, Quinn Jones
Details
emerge --info (emerge-info.txt,8.20 KB, text/plain)
2022-12-02 01:48 UTC, Quinn Jones
Details
emerge -pqv '=net-analyzer/net-snmp-5.9.3-r1::gentoo' (file_883945.txt,328 bytes, text/plain)
2022-12-02 01:49 UTC, Quinn Jones
Details
config.log from recent attempt (compile was successful, though) (config.log.gz,76.95 KB, application/gzip)
2022-12-02 03:13 UTC, Quinn Jones
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Quinn Jones 2022-12-02 01:47:56 UTC
Created attachment 838873 [details]
build.log

I'm copy/pasting from a forum post where I first asked about this; a developer named sam_ advised me to file a bug even though there is a work-around.

https://forums.gentoo.org/viewtopic.php?p=8761243

-----

I'm getting an error during an "emerge -uDNav world" for the above-named package. I've retried a couple of times, and run 'MAKEOPTS="-j1" emerge -av1 =net-analyzer/net-snmp-5.9.3-r1' to isolate the error's context:

...
libtool: link: x86_64-pc-linux-gnu-gcc -Wl,-O1 -Wl,--as-needed -Os -pipe -fomit-frame-pointer -march=native -mtune=native -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -DNETSNMP_REMOVE_U64 -Os -pipe -fomit-frame-pointer -march=native -mtune
=native -Ulinux -Dlinux=linux -o .libs/snmpps .libs/snmpps.o -Wl,-O1 -Wl,--as-needed  -lcurses ../snmplib/.libs/libnetsnmp.so -lm -lssl -lcrypto
/usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: .libs/snmpps.o: undefined reference to symbol 'halfdelay'
/usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib64/libtinfo.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Makefile:354: snmpps] Error 1
make: Leaving directory '/var/tmp/portage/net-analyzer/net-snmp-5.9.3-r1/work/net-snmp-5.9.3/apps'
 * ERROR: net-analyzer/net-snmp-5.9.3-r1::gentoo failed (compile phase):
 *   emake failed
 *
 * If you need support, post the output of `emerge --info '=net-analyzer/net-snmp-5.9.3-r1::gentoo'`,
... 


I've also googled around a bit and found similar errors, but for different packages. One recommended changes to ncurses USE flags, but was then fixed through the ebuild. (https://bugs.gentoo.org/653028)

build.log: https://pastebin.com/raw/GujewJqB
emerge --info: https://pastebin.com/raw/aX2qEekx
Comment 1 Quinn Jones 2022-12-02 01:48:28 UTC
Created attachment 838875 [details]
emerge --info
Comment 2 Quinn Jones 2022-12-02 01:49:11 UTC
Created attachment 838877 [details]
emerge -pqv '=net-analyzer/net-snmp-5.9.3-r1::gentoo'
Comment 3 Quinn Jones 2022-12-02 01:50:02 UTC
Work-around was to customize build environment for this package to build with -O2.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-12-02 01:50:19 UTC
Thanks! It's indeed a missing -ltinfo somewhere (it's possible our patch to add it is incomplete).
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-12-02 02:01:13 UTC
Could you upload /var/tmp/portage/net-analyzer/net-snmp-5.9.3-r1/work/net-snmp-5.9.3/config.log?
Comment 6 Larry the Git Cow gentoo-dev 2022-12-02 02:51:47 UTC
The bug has been referenced in the following commit(s):

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

commit 4ab69c8447b50953c90c7524d09cd836f57355ef
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-12-02 02:50:52 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-12-02 02:51:40 +0000

    net-analyzer/net-snmp: fix LDFLAGS ordering; rebase patches
    
    No guarantee this fixes the reported bug but it needed doing anyway
    and I've sent the rebased patches upstream. It'll make the situation
    easier to deal with now these are tidied up, anyway.
    
    Unfortunately couldn't reproduce the bug yet w/ -Os.
    
    Bug: https://bugs.gentoo.org/883945
    Signed-off-by: Sam James <sam@gentoo.org>

 ...p-5.9.3-0001-Fix-LDFLAGS-vs-LIBS-ordering.patch | 231 ++++++++++++++++++++
 ...5.9.3-0002-Tidy-up-net-snmp-config-output.patch |  51 +++++
 ...ne-Libs.private-entries-in-netsnmp-.pc.in.patch |  30 +++
 ...-Search-for-ltinfo-in-configure-if-needed.patch |  24 +++
 net-analyzer/net-snmp/net-snmp-5.9.3-r2.ebuild     | 233 +++++++++++++++++++++
 net-analyzer/net-snmp/net-snmp-9999.ebuild         |  13 +-
 6 files changed, 576 insertions(+), 6 deletions(-)
Comment 7 Quinn Jones 2022-12-02 03:11:07 UTC
(In reply to Sam James from comment #5)
> Could you upload
> /var/tmp/portage/net-analyzer/net-snmp-5.9.3-r1/work/net-snmp-5.9.3/config.
> log?

Well, this is distressing.

I can upload *a* config.log, but not *the* config.log.

It's currently compiling fine with -Os. I removed my mitigation to get you a clean, non-working config, except now it's working. I don't think anything else is different from before, except that I finished my @world updates the other day.

I'm attaching what I've got, in case it helps, but again - this config.log is from a *working* compilation.
Comment 8 Quinn Jones 2022-12-02 03:13:36 UTC
Created attachment 838883 [details]
config.log from recent attempt (compile was successful, though)
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-12-02 03:16:58 UTC
(In reply to Quinn Jones from comment #7)
> (In reply to Sam James from comment #5)
> > Could you upload
> > /var/tmp/portage/net-analyzer/net-snmp-5.9.3-r1/work/net-snmp-5.9.3/config.
> > log?
> 
> Well, this is distressing.
> 
> I can upload *a* config.log, but not *the* config.log.
> 
> It's currently compiling fine with -Os. I removed my mitigation to get you a
> clean, non-working config, except now it's working. I don't think anything
> else is different from before, except that I finished my @world updates the
> other day.
> 
> I'm attaching what I've got, in case it helps, but again - this config.log
> is from a *working* compilation.

No worries, but very mysterious! Please let me know if you manage to hit it again. I'll close the bug as WORKSFORME for now.

At the very least, something good came out of this, as you motivated me to rebase our patches and finally send them upstream :)