You are not logged in.
Hi all,
I'm not sure if this is the right place to post this question, so sorry in advance for any inconvenience.
I'm trying to cross-compile an application for an aarch64-linux-gnu target by using the cross-compiler from the official repositories (community/aarch64-linux-gnu-gcc 6.3.1-1).
My question is very straightforward: compilation works without -static flag, fails with -static flag. What should I do?
Linker error is as follows
/usr/lib/gcc/aarch64-linux-gnu/6.3.1/../../../../aarch64-linux-gnu/bin/ld: cannot find -lstdc++
Clearly libstdc++.a is missing somewhere (the dynamic version exists, though). Here's sample terminal output
[mbrandalero: aarch64-linux-gnu]$ pwd
/usr/aarch64-linux-gnu
[mbrandalero: aarch64-linux-gnu]$ find . -name "libstdc++.*"
./lib64/libstdc++.so
./lib64/libstdc++.so.6.0.22-gdb.py
./lib64/libstdc++.so.6
./lib64/libstdc++.so.6.0.22
Should I manually compile the library from scratch, or is it included in some other package, or am I'm missing something here?
Thanks in advance!
Last edited by mbrandalero (2017-06-21 18:39:43)
Offline
See `pacman -Fs libstdc++.a`
EDIT: oops, I suppose my command only confirms it is not available int the repos specifically for that cross compiler.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
See `pacman -Fs libstdc++.a`
EDIT: oops, I suppose my command only confirms it is not available int the repos specifically for that cross compiler.
Thank you for your reply. Although it didn't solve the problem specifically, at least now I know how to search for a specific file in the repos with pacman :-)
I managed to solve the issue by manually downloading gcc-7.1.0 from here, compiling stdlibc++ using HOST=aarch64-linux-gnu and then copying it to the aarch64 library path.
Last edited by mbrandalero (2017-06-22 15:37:23)
Offline
You could file a bug that static libs in `aarch64-linux-gnu-gcc` are missing. Likely the static libs are even built but and just not packaged because the PKGBUILD option `staticlibs` is missing. Including static libs in accordance to native `gcc` package would make sense IMO.
Last edited by The Infinity (2017-07-03 22:08:41)
Offline