LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM
User Name
Password
Slackware - ARM This forum is for the discussion of Slackware ARM.

Notices


Reply
  Search this Thread
Old 09-02-2017, 06:22 AM   #1
caffe
LQ Newbie
 
Registered: Feb 2015
Posts: 6

Rep: Reputation: Disabled
linking fails with clang on slackware-arm current


I just installed slackware-arm current today and compiling with clang fails. Is my installation corrupt or do others have the same problem?

Code:
$ echo 'int main(int argc, char **argv) { return 0; }' > test.c
$ clang -v test.c
clang version 4.0.1 (tags/RELEASE_401/final)
Target: armv7l-unknown-linux-gnueabihf
Thread model: posix
InstalledDir: /usr/bin
 "/usr/bin/clang-4.0" -cc1 -triple armv7-unknown-linux-gnueabihf -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name test.c -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -target-cpu cortex-a8 -target-abi aapcs-linux -mfloat-abi hard -v -dwarf-column-info -debugger-tuning=gdb -resource-dir /usr/bin/../lib/clang/4.0.1 -cxx-isystem /usr/lib/qt/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/clang/4.0.1/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdebug-compilation-dir /root -ferror-limit 19 -fmessage-length 212 -fallow-half-arguments-and-returns -fno-signed-char -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/test-36c9aa.o -x c test.c
clang -cc1 version 4.0.1 based upon LLVM 4.0.1 default target armv7l-unknown-linux-gnueabihf
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/bin/../lib/clang/4.0.1/include
 /usr/include
End of search list.
 "/usr/bin/ld" -X --eh-frame-hdr -m armelf_linux_eabi -dynamic-linker /lib/ld-linux-armhf.so.3 -o a.out /usr/bin/../lib/crt1.o /usr/bin/../lib/crti.o crtbegin.o -L/usr/bin/../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/bin/../lib -L/lib -L/usr/lib /tmp/test-36c9aa.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed crtend.o /usr/bin/../lib/crtn.o
/usr/bin/ld: cannot find crtbegin.o: No such file or directory
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: cannot find -lgcc
clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
$ grep crtbegin.o /var/log/packages/*
/var/log/packages/gcc-7.2.0-arm-1:usr/lib/gcc/arm-slackware-linux-gnueabi/7.2.0/crtbegin.o
gcc works fine:
Code:
$ gcc -v test.c
Reading specs from /usr/lib/gcc/arm-slackware-linux-gnueabi/7.2.0/specs
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/arm-slackware-linux-gnueabi/7.2.0/lto-wrapper
Target: arm-slackware-linux-gnueabi
Configured with: ../gcc-7.2.0/configure --with-march=armv7-a --with-float=hard --disable-werror --prefix=/usr --mandir=/usr/man --infodir=/usr/info --libdir=/usr/lib --enable-bootstrap --enable-checking=release --with-system-zlib --disable-libunwind-exceptions --enable-libstdcxx-dual-abi --with-default-libstdcxx-abi=gcc4-compatible --enable-shared --enable-languages=c,c++,ada,fortran,go,lto,objc --enable-objc-gc --enable-threads=posix --enable-__cxa_atexit --enable-libssp --enable-lto --with-gnu-ld --verbose --with-arch-directory= --disable-gtktest --disable-install-libiberty --host=arm-slackware-linux-gnueabi --build=arm-slackware-linux-gnueabi --target=arm-slackware-linux-gnueabi
Thread model: posix
gcc version 7.2.0 (GCC)
COLLECT_GCC_OPTIONS='-v' '-mfloat-abi=hard' '-mtls-dialect=gnu'
 /usr/libexec/gcc/arm-slackware-linux-gnueabi/7.2.0/cc1 -quiet -v test.c -quiet -dumpbase test.c -mfloat-abi=hard -mtls-dialect=gnu -auxbase test -version -o /tmp/cci8TCcd.s
GNU C11 (GCC) version 7.2.0 (arm-slackware-linux-gnueabi)
        compiled by GNU C version 7.2.0, GMP version 6.1.2, MPFR version 3.1.5, MPC version 1.0.3, isl version none
GGC heuristics: --param ggc-min-expand=94 --param ggc-min-heapsize=120220
ignoring nonexistent directory "/usr/lib/gcc/arm-slackware-linux-gnueabi/7.2.0/../../../../arm-slackware-linux-gnueabi/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/arm-slackware-linux-gnueabi/7.2.0/include
 /usr/local/include
 /usr/lib/gcc/arm-slackware-linux-gnueabi/7.2.0/include-fixed
 /usr/include
End of search list.
GNU C11 (GCC) version 7.2.0 (arm-slackware-linux-gnueabi)
        compiled by GNU C version 7.2.0, GMP version 6.1.2, MPFR version 3.1.5, MPC version 1.0.3, isl version none
GGC heuristics: --param ggc-min-expand=94 --param ggc-min-heapsize=120220
Compiler executable checksum: 3d6ca12b7c8d4c3b2b425e93effa328a
COLLECT_GCC_OPTIONS='-v' '-mfloat-abi=hard' '-mtls-dialect=gnu'
 /usr/lib/gcc/arm-slackware-linux-gnueabi/7.2.0/../../../../arm-slackware-linux-gnueabi/bin/as -v -mfloat-abi=hard -meabi=5 -o /tmp/ccJgT2Hj.o /tmp/cci8TCcd.s
GNU assembler version 2.29 (arm-slackware-linux-gnueabi) using BFD version version 2.29-slack15
COMPILER_PATH=/usr/libexec/gcc/arm-slackware-linux-gnueabi/7.2.0/:/usr/libexec/gcc/arm-slackware-linux-gnueabi/7.2.0/:/usr/libexec/gcc/arm-slackware-linux-gnueabi/:/usr/lib/gcc/arm-slackware-linux-gnueabi/7.2.0/:/usr/lib/gcc/arm-slackware-linux-gnueabi/:/usr/lib/gcc/arm-slackware-linux-gnueabi/7.2.0/../../../../arm-slackware-linux-gnueabi/bin/
LIBRARY_PATH=/usr/lib/gcc/arm-slackware-linux-gnueabi/7.2.0/:/usr/lib/gcc/arm-slackware-linux-gnueabi/7.2.0/../../../../arm-slackware-linux-gnueabi/lib/:/usr/lib/gcc/arm-slackware-linux-gnueabi/7.2.0/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-mfloat-abi=hard' '-mtls-dialect=gnu'
 /usr/libexec/gcc/arm-slackware-linux-gnueabi/7.2.0/collect2 -plugin /usr/libexec/gcc/arm-slackware-linux-gnueabi/7.2.0/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/arm-slackware-linux-gnueabi/7.2.0/lto-wrapper
-plugin-opt=-fresolution=/tmp/ccgwGvKu.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --eh-frame-hdr -dynamic-linker /lib/ld-linux-armhf.so.3 -X --hash-style=gnu -m armelf_linux_eabi /usr/lib/gcc/arm-slackware-linux-gnueabi/7.2.0/../../../crt1.o /usr/lib/gcc/arm-slackware-linux-gnueabi/7.2.0/../../../crti.o /usr/lib/gcc/arm-slackware-linux-gnueabi/7.2.0/crtbegin.o -L/usr/lib/gcc/arm-slackware-linux-gnueabi/7.2.0 -L/usr/lib/gcc/arm-slackware-linux-gnueabi/7.2.0/../../../../arm-slackware-linux-gnueabi/lib -L/usr/lib/gcc/arm-slackware-linux-gnueabi/7.2.0/../../.. /tmp/ccJgT2Hj.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/arm-slackware-linux-gnueabi/7.2.0/crtend.o /usr/lib/gcc/arm-slackware-linux-gnueabi/7.2.0/../../../crtn.o
COLLECT_GCC_OPTIONS='-v' '-mfloat-abi=hard' '-mtls-dialect=gnu'
 
Old 09-03-2017, 04:18 AM   #2
drmozes
Slackware Contributor
 
Registered: Apr 2008
Location: Surrey, England
Distribution: Slackware
Posts: 604

Rep: Reputation: 428Reputation: 428Reputation: 428Reputation: 428Reputation: 428
Quote:
Originally Posted by caffe View Post
I just installed slackware-arm current today and compiling with clang fails. Is my installation corrupt or do others have the same problem?
Thanks - I'm looking at it.
 
Old 09-03-2017, 01:05 PM   #3
glorsplitz
Member
 
Registered: Dec 2002
Distribution: slackware!
Posts: 497

Rep: Reputation: 88
my rpi3 slackware arm current is all up to date and got samething

Code:
.
.
.
/usr/bin/ld: cannot find crtbegin.o: No such file or directory
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: cannot find -lgcc
clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)

grep crtbegin.o /var/log/packages/*
/var/log/packages/gcc-7.2.0-arm-1:usr/lib/gcc/arm-slackware-linux-gnueabi/7.2.0/crtbegin.o

Last edited by glorsplitz; 09-03-2017 at 01:07 PM.
 
Old 09-03-2017, 01:32 PM   #4
drmozes
Slackware Contributor
 
Registered: Apr 2008
Location: Surrey, England
Distribution: Slackware
Posts: 604

Rep: Reputation: 428Reputation: 428Reputation: 428Reputation: 428Reputation: 428
The problem is that llvm doesn't know the architecture triplet (or quadlet, as it actually is), and when I supply the quadlet it builds for soft float, but when I force it to build hard float, it again cannot find the libraries. I think this happened when I dropped a boat load of patches from Debian, which were holding the ship together.

After hacking around with llvm, I've decided to rebuild the entire toolchain (gcc, binutils et al) and change the architecture quadlet from arm-slackware-linux-gnieabi -> arm-slackware-linux-gnueabihf -- since the "hf" suffix is now being commonly used to determine which ABI to build for.
That should fix a few problems going forwards.
 
Old 09-04-2017, 01:09 PM   #5
glorsplitz
Member
 
Registered: Dec 2002
Distribution: slackware!
Posts: 497

Rep: Reputation: 88
drmozes, so does this mean there will be a fix issued for existing installs OR it's only possible for new installs? just curious, THANKS!
 
Old 09-05-2017, 04:04 AM   #6
drmozes
Slackware Contributor
 
Registered: Apr 2008
Location: Surrey, England
Distribution: Slackware
Posts: 604

Rep: Reputation: 428Reputation: 428Reputation: 428Reputation: 428Reputation: 428
Quote:
Originally Posted by glorsplitz View Post
drmozes, so does this mean there will be a fix issued for existing installs OR it's only possible for new installs? just curious, THANKS!
It's only a minor naming change, resulting in a handful of package rebuilds so you'll upgrade to the new packages when they're out; which would have been today except for having built Linux 4.13.0, only to find that it's dropped the support for the OrangePi NIC so I have to build rc7 instead.

Last edited by drmozes; 09-05-2017 at 04:22 AM.
 
1 members found this post helpful.
Old 09-05-2017, 03:43 PM   #7
drmozes
Slackware Contributor
 
Registered: Apr 2008
Location: Surrey, England
Distribution: Slackware
Posts: 604

Rep: Reputation: 428Reputation: 428Reputation: 428Reputation: 428Reputation: 428
Code:
root@stokely:~/ac/source/d/llvm/EXCLUDE# cat test
echo 'int main(int argc, char **argv) { return 0; }' > /tmp/test.c
cd /tmp
clang -v test.c
#gcc -v test.c
root@stokely:~/ac/source/d/llvm/EXCLUDE# ./test
clang version 4.0.1 (tags/RELEASE_401/final)
Target: arm-slackware-linux-gnueabihf
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/arm-slackware-linux-gnueabihf/7.2.0
Found candidate GCC installation: /usr/lib/gcc/arm-slackware-linux-gnueabihf/7.2.0
Selected GCC installation: /usr/bin/../lib/gcc/arm-slackware-linux-gnueabihf/7.2.0
Candidate multilib: .;@m32
Selected multilib: .;@m32
 "/usr/bin/clang-4.0" -cc1 -triple armv6kz-slackware-linux-gnueabihf -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name test.c -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -fuse-init-array -target-cpu arm1176jzf-s -target-feature +strict-align -target-abi aapcs-linux -mfloat-abi hard -v -dwarf-column-info -debugger-tuning=gdb -resource-dir /usr/bin/../lib/clang/4.0.1 -cxx-isystem /usr/lib/qt/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/clang/4.0.1/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdebug-compilation-dir /tmp -ferror-limit 19 -fmessage-length 139 -fallow-half-arguments-and-returns -fno-signed-char -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/test-7df9fb.o -x c test.c
clang -cc1 version 4.0.1 based upon LLVM 4.0.1 default target arm-slackware-linux-gnueabihf
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/bin/../lib/clang/4.0.1/include
 /usr/include
End of search list.
 "/usr/bin/ld" -X --eh-frame-hdr -m armelf_linux_eabi -dynamic-linker /lib/ld-linux-armhf.so.3 -o a.out /usr/bin/../lib/gcc/arm-slackware-linux-gnueabihf/7.2.0/../../../../lib/crt1.o /usr/bin/../lib/gcc/arm-slackware-linux-gnueabihf/7.2.0/../../../../lib/crti.o /usr/bin/../lib/gcc/arm-slackware-linux-gnueabihf/7.2.0/crtbegin.o -L/usr/bin/../lib/gcc/arm-slackware-linux-gnueabihf/7.2.0 -L/usr/bin/../lib/gcc/arm-slackware-linux-gnueabihf/7.2.0/../../../../arm-slackware-linux-gnueabihf/lib/../lib -L/usr/bin/../lib/gcc/arm-slackware-linux-gnueabihf/7.2.0/../../../../lib -L/usr/bin/../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/bin/../lib/gcc/arm-slackware-linux-gnueabihf/7.2.0/../../../../arm-slackware-linux-gnueabihf/lib -L/usr/bin/../lib/gcc/arm-slackware-linux-gnueabihf/7.2.0/../../.. -L/usr/bin/../lib -L/lib -L/usr/lib /tmp/test-7df9fb.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/bin/../lib/gcc/arm-slackware-linux-gnueabihf/7.2.0/crtend.o /usr/bin/../lib/gcc/arm-slackware-linux-gnueabihf/7.2.0/../../../../lib/crtn.o
root@stokely:~/ac/source/d/llvm/EXCLUDE#
Fixed! I don't know when I'll push this out though as mariadb's soiled its nappy now,and I can't push anything until I fix it.
I might attempt to figure out why it chooses armv6kz at some point: I guess it's a default somewhere.

Last edited by drmozes; 09-05-2017 at 04:55 PM.
 
1 members found this post helpful.
Old 09-05-2017, 08:15 PM   #8
glorsplitz
Member
 
Registered: Dec 2002
Distribution: slackware!
Posts: 497

Rep: Reputation: 88
Many thanks for timely resolution and timely info update, and thanks for all you do too!
 
Old 09-06-2017, 04:52 AM   #9
drmozes
Slackware Contributor
 
Registered: Apr 2008
Location: Surrey, England
Distribution: Slackware
Posts: 604

Rep: Reputation: 428Reputation: 428Reputation: 428Reputation: 428Reputation: 428
Quote:
Originally Posted by glorsplitz View Post
Many thanks for timely resolution and timely info update, and thanks for all you do too!
No worries! I've hacked mariadb to build, so the build machines are now busy churning through the remainder of the batch of packages.
 
2 members found this post helpful.
Old 09-06-2017, 04:15 PM   #10
caffe
LQ Newbie
 
Registered: Feb 2015
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by drmozes View Post
Fixed!
, ta!
 
Old 09-07-2017, 09:54 PM   #11
glorsplitz
Member
 
Registered: Dec 2002
Distribution: slackware!
Posts: 497

Rep: Reputation: 88
just did latest upgrades, caffe post #1 "clang -v test.c" no errors, Thanks drmozes!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Slackware ARM (current) epic mistake: the current Android kernels are kicked out! Darth Vader Slackware 16 08-25-2013 05:36 PM
[SOLVED] setup fails on most current Slackware-current March 26, 2012 AlleyTrotter Slackware 15 04-09-2012 07:05 AM
Slackware x86_64 '-current' FireFox & Thunderbird issues with linking onebuck Slackware 6 01-22-2010 03:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM

All times are GMT -5. The time now is 03:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration