Hi, 

Ihave very basic question about creating shared lib on solaris



I have very simple makefile



.SOURCE.h:$(VROOT)/src/include

CC=CC

CCFLAGS+=$$(CC.DLL)

CCFLAGS+=-mt -xtarget=ultra -xarch=v9 -xinline=val_ref,val_unref -errtags

LDFLAGS+=-mt -xtarget=ultra -xarch=v9

SRC=DoSomething.cc

:ALL: DoSomething

DoSomething - :LIBRARY: $(SRC)



Everything works fine except I get error during linking:



$nmake

++ echo '' -lDoSomething

++ CC -O -D_BLD_DLL -KPIC -mt -xtarget=ultra -xarch=v9 
-xinline=val_ref,val_unref -errtags 
-I/net/nasdub/vol/eng/home/krzystof/work/nmake/simple/cvs/src/include -I- -I. 
-I/net/nasdub/vol/eng/home/krzystof/work/nmake/simple/cvs/src/include -c 
/net/nasdub/vol/eng/home/krzystof/work/nmake/simple/cvs/src/lib1/DoSomething.cc

make: warning: DoSomething.o file system time lags local time by at least 1m33s

++ CC -xar -o libDoSomething.a DoSomething.o

++ /opt/SUNWspro/bin/CC -G -o libDoSomething.so DoSomething.o

ld: fatal: file DoSomething.o: wrong ELF class: ELFCLASS64

ld: fatal: File processing errors. No output written to libDoSomething.so

make: *** exit code 1 making libDoSomething.so



The Problem is that nmake doesn't pass LDFLAGS to linker hence the error. It is 
important to compile and link with the same set of flags if the last line would 
be:

 /opt/SUNWspro/bin/CC $(LDFLAGS) -G -o libDoSomething.so DoSomething.o

i.e. after expansion 

 /opt/SUNWspro/bin/CC -mt -xtarget=ultra -xarch=v9 -G -o libDoSomething.so 
DoSomething.o

everything works fine



So the question is how to properly write Makefile or what switches variables to 
set

to get this behaviour.





Thanks in advance



Krzysztof






_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to