Ticket 176: CFLAGS not passed to libtool on linkage preventing 64 bit build
When building a 64 bit library an error is produced on linkage:
...
./libtool --quiet --mode=compile /opt/studio/SOS11/SUNWspro/bin/cc -c -xO3 -xarch=v9 -I/opt/csw/include mm_vers.c
./libtool --quiet --mode=link /opt/studio/SOS11/SUNWspro/bin/cc -o libmm.la mm_global.lo mm_alloc.lo mm_core.lo mm_lib.lo mm_vers.lo \
-rpath /opt/csw/lib/64 -version-info `./shtool version -l c -d libtool mm_vers.c`
./libtool --quiet --mode=compile /opt/studio/SOS11/SUNWspro/bin/cc -c -xO3 -xarch=v9 -I/opt/csw/include mm_test.c
./libtool --quiet --mode=link /opt/studio/SOS11/SUNWspro/bin/cc -o mm_test mm_test.lo libmm.la
ld: fatal: file .libs/mm_test.o: wrong ELF class: ELFCLASS64
ld: fatal: File processing errors. No output written to .libs/mm_test
gmake[2]: *** [mm_test] Error 1
This is because the CFLAGS turning on 64 bit are not passed to libtool.
Remarks:
2009-Sep-09 16:45:33 by anonymous:
This patch solves the problem:
diff -Naur mm-1.4.2.orig/Makefile.in mm-1.4.2.patched/Makefile.in
--- mm-1.4.2.orig/Makefile.in 2006-08-10 21:05:55.000000000 +0200
+++ mm-1.4.2.patched/Makefile.in 2009-09-09 16:25:45.161331795 +0200
@@ -75,14 +75,14 @@
all: $(LIBS) $(MANS) $(TSTS)
libmm.la: $(OBJS)
- $(LIBTOOL) --quiet --mode=link $(CC) -o $@ $(OBJS) \
+ $(LIBTOOL) --quiet --mode=link $(CC) $(CFLAGS) -o $@ $(OBJS) \
-rpath $(libdir) -version-info `$(SHTOOL) version -l c -d libtool mm_vers.c`
mm_alloc.c mm_core.c mm_global.c: mm.h mm_vers.c
mm.h: config.h
mm_test: mm_test.lo libmm.la
- $(LIBTOOL) --quiet --mode=link $(CC) -o $@ mm_test.lo libmm.la
+ $(LIBTOOL) --quiet --mode=link $(CC) $(CFLAGS) -o $@ mm_test.lo libmm.la
mm.3: mm.pod
V1=`$(SHTOOL) version -l c -d short mm_vers.c`; \
Properties:
Type: |
code |
|
Version: |
1.4.2 |
Status: |
new |
|
Created: |
2009-Sep-09 16:44 |
Severity: |
2 |
|
Last Change: |
2009-Sep-09 16:45 |
Priority: |
3 |
|
Subsystem: |
mm |
Assigned To: |
rse |
|
Derived From: |
|
Creator: |
anonymous |