dslinux/toolchain Makefile
stsp
stsp at user.in-berlin.de
Fri Sep 1 03:57:22 CEST 2006
Update of /cvsroot/dslinux/dslinux/toolchain
In directory antilope:/tmp/cvs-serv30438
Modified Files:
Makefile
Log Message:
Do not copy libc.a to libg.a. Create a dummy libg.a library instead.
Should fix linker errors due to multiple definitions of symbols.
Which I've seen only once yet during testing, not regular compiling.
But I wanted to fix this anyway before we ever run into this :)
Index: Makefile
===================================================================
RCS file: /cvsroot/dslinux/dslinux/toolchain/Makefile,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- Makefile 27 Aug 2006 20:41:07 -0000 1.20
+++ Makefile 1 Sep 2006 01:57:20 -0000 1.21
@@ -295,16 +295,20 @@
CROSS=$(TARGET)-
touch $@
+# XXX: Apparently there is a switch in the compiler specs that
+# causes the -g flag to link with libg.a in addition to libc.a.
+# uClibc does not provide libg.a, so linking fails if -g is
+# in CFLAGS. Create a dummy libg.a to work around this.
+$(PREFIX)/$(TARGET)/lib/libg.a:
+ echo 'void __libg__dummy(){};' | $(TARGET)-gcc -xc -c -o libg.o -
+ $(TARGET)-ar r libg.a libg.o
+ rm libg.o
+ mv libg.a $(PREFIX)/$(TARGET)/lib/
+
# install uClibc
-$(SRCDIR)/.uClibc-installed: $(SRCDIR)/.uClibc-compiled
+$(SRCDIR)/.uClibc-installed: $(SRCDIR)/.uClibc-compiled \
+ $(PREFIX)/$(TARGET)/lib/libg.a
$(MAKE) -C $(UCLIBC_SRCDIR) PREFIX=$(PREFIX) install
- # XXX: Apparently there is a switch in the compiler specs that
- # causes the -g flag to use libg.a and not libc.a.
- # uClibc does not provide libg.a, so linking fails if -g is
- # in CFLAGS. Copying libc.a to libg.a seems make things work.
- # Workaround taken from notes by Phil Wilshire found at
- # http://www.ucdot.org/article.pl?sid=03/01/07/0214244
- cp $(PREFIX)/$(TARGET)/lib/libc.a $(PREFIX)/$(TARGET)/lib/libg.a
touch $@
More information about the dslinux-commit
mailing list