Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 664060 - dev-libs/libtasn1-4.13: fails to link with error "undefined reference to __builtin_add_overflow_p"
Summary: dev-libs/libtasn1-4.13: fails to link with error "undefined reference to __bu...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Crypto team [DISABLED]
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-19 17:13 UTC by Michael 'veremitz' Everitt
Modified: 2018-08-19 20:14 UTC (History)
2 users (show)

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


Attachments
build.log (file_664060.txt,164.45 KB, text/plain)
2018-08-19 17:13 UTC, Michael 'veremitz' Everitt
Details
emerge --info (file_664060.txt,1.80 KB, text/plain)
2018-08-19 19:23 UTC, Michael 'veremitz' Everitt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael 'veremitz' Everitt 2018-08-19 17:13:36 UTC
Created attachment 544040 [details]
build.log

libtasn1 fails to complete building with errors:
 'undefined reference to __builtin_add_overflow_p'
 'undefined reference to __builtin_nul_overflow_p'

Discussion today on #gentoo-crypto with [Arfever] suggests that it's a problem with gcc-6.4.0 which doesn't manifest under gcc-7.3.0.
Comment 1 Michael 'veremitz' Everitt 2018-08-19 17:19:09 UTC
$ gcc-6.4.0 -x c - -o test <<< "int main(){__builtin_add_overflow_p; __builtin_mul_overflow_p;}"
<stdin>: In function ‘main’:
<stdin>:1:12: error: ‘__builtin_add_overflow_p’ undeclared (first use in this function)
<stdin>:1:12: note: each undeclared identifier is reported only once for each function it appears in
<stdin>:1:38: error: ‘__builtin_mul_overflow_p’ undeclared (first use in this function)
$ gcc-7.3.0 -x c - -o test <<< "int main(){__builtin_add_overflow_p; __builtin_mul_overflow_p;}"
$
Comment 2 Alon Bar-Lev (RETIRED) gentoo-dev 2018-08-19 17:37:23 UTC
This is probably related to gnulib, but these should exist in all recent compilers. adding arm to take a look.

Please attach emerge --info.
Comment 3 Michael 'veremitz' Everitt 2018-08-19 19:17:47 UTC
Confirmed in https://gcc.gnu.org/gcc-7/changes.html:

New __builtin_add_overflow_p, __builtin_sub_overflow_p, __builtin_mul_overflow_p built-in functions have been added. These work similarly to their siblings without the _p suffix, but do not actually store the result of the arithmetics anywhere, just return whether the operation would overflow. Calls to these built-ins with integer constant arguments evaluate to integer constants expressions.
Comment 4 Michael 'veremitz' Everitt 2018-08-19 19:23:50 UTC
Created attachment 544048 [details]
emerge --info

This is obviously somewhat shorted than normal, as it comes from a catalyst stage chroot.
Comment 5 Michael 'veremitz' Everitt 2018-08-19 20:14:27 UTC
Scratch that one folks - sorry!

There was a clash between an id10t and the PEBKAC which resulted in the wrong distcc slave 'client' being invoked on the amd64 box that supports my ARM builders.

Thanks to a tip from the cluster team, this amd64 box actually has three distcc daemons with different gcc slots running on different ports, and I had picked the wrong port for this particular build configuration.

Thanks all for the pointers tracking this one down. The combination was the GCC features, with the emerge info confirming that gcc-7 was indeed 'correct' but finding the relevant catalyst spec file with the incorrect port number!!