This topic contains 3 replies, has 2 voices, and was last updated by Alex 7 months ago.
August 10, 2016 at 12:58 am #77195
Attempting to build ELLCC from source on an Ubuntu Xenial x86_64 box and keep running into an error while building metalinkcat.
The rported error is:
/home/vagrant/ellcc/bin/ecc-ld: attempted static link of dynamic object/usr/lib/x86_64-linux-gnu/libexpat.so’`
The output from the build process is:
/home/vagrant/ellcc/libecc/../bin/ecc -target arm64v8-linux -DHAVE_CONFIG_H -I. -I../../../../src/libmetalink/doc/examples -I../.. -I../../../../src/libmetalink/lib/includes -I../../lib/includes -DHAVE_INTTYPES_H -target arm64v8-linux -g -MT metalinkcat.o -MD -MP -MF .deps/metalinkcat.Tpo -c -o metalinkcat.o metalinkcat.c mv -f .deps/metalinkcat.Tpo .deps/metalinkcat.Po /bin/bash ../../libtool --tag=CC --mode=link /home/vagrant/ellcc/libecc/../bin/ecc -target arm64v8-linux -target arm64v8-linux -g -target arm64v8-linux -o metalinkcat metalinkcat.o ../../lib/libmetalink.la libtool: link: /home/vagrant/ellcc/libecc/../bin/ecc -target arm64v8-linux -target arm64v8-linux -g -target arm64v8-linux -o metalinkcat metalinkcat.o ../../lib/.libs/libmetalink.a /usr/lib/x86_64-linux-gnu/libexpat.so clang-4.0: warning: argument unused during compilation: '-g' /home/vagrant/ellcc/bin/ecc-ld: attempted static link of dynamic object
clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
Makefile:359: recipe for target ‘metalinkcat’ failed
make: *** [metalinkcat] Error 1
Makefile:365: recipe for target ‘all-recursive’ failed
make: *** [all-recursive] Error 1
Makefile:415: recipe for target ‘all-recursive’ failed
make: *** [all-recursive] Error 1
Makefile:345: recipe for target ‘all’ failed
make: *** [all] Error 2
Makefile:432: recipe for target ‘arm64v8-linux.libmetalink.build’ failed
make: *** [arm64v8-linux.libmetalink.build] Error 2
Makefile:404: recipe for target ‘arm64v8-linux’ failed
make: *** [arm64v8-linux] Error 2
make: Leaving directory ‘/home/vagrant/ellcc/libecc’
Make failed for libecc
Error: leaving module
Makefile:16: recipe for target ‘me’ failed
make: *** [me] Error 1`
Can anyone provide any insight into this error?August 21, 2016 at 8:05 pm #77227
Does anyone have any ideas about this?
Would really love to get ELLCC compiling completely so I can start using it.August 23, 2016 at 6:44 am #77229
Sorry it has taken so long to get back to you.
I think the problem is that libtool is mistakenly giving the system libexpat.so to the linker when trying to build the metalinkcat utility,
Originally I tried to build ELLCC from scratch on my Fedora system which has libexpat installed. Unfortunately the build went just fine: build with gcc worked, subsequent build with ecc worked. I’m not sure why Ubuntu would be different, unfortunately.
The good news is that you have everything you need built. If you were to edit /home/vagrant/ellcc/libecc/Makefile to remove the libmetalink parts, I think the rest of your build would go OK. Comment this part out:
$(Configs):: musl.install $(OUT)$(MAKE) $(MFLAGS) $@.libmetalink.configure && \ $(MAKE) $(MFLAGS) $@.libmetalink.build && \ $(MAKE) $(MFLAGS) $@.libmetalink.install
-RichAugust 29, 2016 at 8:12 pm #77284
I went the other way around and figured out how to solve the problem. I believe that libtool found libexpat.la in /usr/lib/x86_64-linux-gnu which informs libtool to use /usr/lib/x86_64-linux-gnu/libexpat.so.
The solution was to copy the generated libexpat.la to libecc/lib and then add libecc/lib to LDFLAGS. This allows libtool to find our libexpat.la which subsequently allows libtool to find our libexpat.a.
Here is a patch that should fix this issue (it works on my system). The patch also includes a small fix to the build-setup script that was preventing the second make pass to not correctly detect that the first make pass had completed.