Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 719662 - net-proxy/squid fails to compile
Summary: net-proxy/squid fails to compile
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mikle Kolyada
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: libatomic-linking CVE-2019-12519, CVE-2019-12521, CVE-2020-11945
  Show dependency tree
 
Reported: 2020-04-26 15:12 UTC by Agostino Sarubbo
Modified: 2020-05-19 09:37 UTC (History)
1 user (show)

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


Attachments
build.log (build.log,796.26 KB, text/plain)
2020-04-26 15:12 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2020-04-26 15:12:13 UTC
This is an auto-filled bug because net-proxy/squid 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.

NOTE:
Feel free to adjust the summary to clarify the exact issue..
Comment 1 Agostino Sarubbo gentoo-dev 2020-04-26 15:12:23 UTC
Created attachment 634710 [details]
build.log

build log and emerge --info
Comment 2 Georgy Yakovlev gentoo-dev 2020-04-26 23:53:13 UTC
can confirm.

configure.ac has the check if libatomic needed.

> ## check for atomics library before anything that might need it                                                                                                                                                                                                                                                       
> # AC_SEARCH_LIBS pollutes LIBS                                                                                                                                                                                                                                                                                        
> SQUID_STATE_SAVE(LIBATOMIC)                                                                                                                                                                                                                                                                                           
> AC_SEARCH_LIBS([__atomic_load_8],[atomic],[                                                                                                                                                                                                                                                                           
>   test "$ac_res" = "none required" || ATOMICLIB=$ac_res],[])                                                                                                                                                                                                                                                          
> SQUID_STATE_ROLLBACK(LIBATOMIC)                                                                                                                                                                                                                                                                                       
> AC_SUBST(ATOMICLIB)



but check misfires

checking for library containing __atomic_load_8... no



since I'm compiling in a ppc32 chroot with 64bit kernel it makes me wonder if this is somehow related?

part of config.log

configure:21154: powerpc-unknown-linux-gnu-g++ -o conftest -O2 -pipe  -Wl,-O1 -Wl,--as-needed conftest.cpp -latomic   >&5
conftest.cpp:56:6: error: new declaration 'char __atomic_load_8()' ambiguates built-in declaration 'long long unsigned int __atomic_load_8(const volatile void*, int)' [-fpermissive]
   56 | char __atomic_load_8 ();
      |      ^~~~~~~~~~~~~~~
conftest.cpp: In function 'int main()':
conftest.cpp:60:25: error: too few arguments to function 'long long unsigned int __atomic_load_8(const volatile void*, int)'
   60 | return __atomic_load_8 ();
      |                         ^
configure:21154: $? = 1
Comment 3 Georgy Yakovlev gentoo-dev 2020-04-27 00:05:05 UTC
looks like autotools is to blame

https://www.mail-archive.com/bug-autoconf@gnu.org/msg04294.html

AC_SEARCH_LIBS is broken with gcc8 and up for some libs and generates incorrect conftest and check is always false.


https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=907277
Comment 4 Georgy Yakovlev gentoo-dev 2020-04-27 06:05:28 UTC
I think doing something like

> inherit .. flag-o-matic ..
> use ppc && append-ldflags '-latomic'

is acceptable as long as -as-needed is passed.
this will link atomic only into objects that actually use it.

I can confirm it builds that way.


fixing autoconf is a bit more involved.
Comment 5 Christian Ruppert (idl0r) gentoo-dev 2020-04-27 07:10:41 UTC
It should be reported upstream, yes. If someone is able to fix that, a patch would be great, for the ebuild as well as upstream.
Comment 6 Larry the Git Cow gentoo-dev 2020-05-18 13:43:59 UTC
The bug has been referenced in the following commit(s):

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

commit c9083ec9e0bc6508dad28ae211d8e3647a1f08e5
Author:     Sam James (sam_c) <sam@cmpct.info>
AuthorDate: 2020-05-08 03:00:53 +0000
Commit:     Mikle Kolyada <zlogene@gentoo.org>
CommitDate: 2020-05-18 13:43:53 +0000

    net-proxy/squid: Fix 32-bit build
    
    Links against libatomic on 32-bit non-x86 arches.
    
    Bug: https://bugs.gentoo.org/719662
    Package-Manager: Portage-2.3.99, Repoman-2.3.22
    Signed-off-by: Sam James (sam_c) <sam@cmpct.info>
    Closes: https://github.com/gentoo/gentoo/pull/15705
    Signed-off-by: Mikle Kolyada <zlogene@gentoo.org>

 net-proxy/squid/squid-4.11.ebuild | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)