~nabijaczleweli/ossp#176: 
[mm 1.4.2] CFLAGS not passed to libtool on linkage preventing 64 bit build

#Upstream Ticket 176 from 2009-09-09 16:44:51

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.

Status
REPORTED
Submitter
~nabijaczleweli
Assigned to
No-one
Submitted
4 months ago
Updated
4 months ago
Labels
CVSTrac mm

~nabijaczleweli 4 months ago

#Final remarks as of 2009-09-09 16:45

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`; \
Register here or Log in to comment, or comment via email.