.s file causing problems when linking

Nathan Thern nthern@gmail.com
Tue Jul 22 20:30:00 GMT 2008


I am attempting to compile MIT/GNU Scheme on cygwin. The build
proceeds fine through the main executable, but fails when linking a
dynamically openable module.

The main executable is created with this command:
> gcc -o scheme.exe cmpauxmd.o <other.o's> <libs>

cmpauxmd.o is created by:
> ./makegen/m4.sh  cmpauxmd.m4 > cmpauxmd.s
> as -o cmpauxmd.o cmpauxmd.s

The <other.o's> are all compiled from .c files.

The first module fails to link as follows:
> gcc -shared -o prbfish.dll prbfish.o <module_libs>
--> Lots of "prbfish.o:prbfish.c: undefined reference to X" where the
X's are symbols defined in both cmpauxmd.o and <other.o's>

So I tried to create a helper lib just to provide symbols for prbfish.dll:
> gcc -shared -o libscheme.dll cmpauxmd.o <other.o's> <libs>
--> Cannot export asm_sc_apply_generic: symbol not found
--> several more "Cannot export"s
All the "Cannot export" symbols are defined in cmpauxmd.o

In fact, I get the same error when I try
> gcc -shared -o prbfish.dll prbfish.o cmpauxmd.o <other.o's> <module_libs> <libs>
--> Cannot export asm_sc_apply_generic: symbol not found
...

Is my approach of building a helper lib the correct one? If so, how do
I resolve the "Cannot export" errors?

OR ... Is there another (better) way to inform ld of the symbols in
scheme.exe in order to succesfully link the module .dll's?

regards,
NT

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list