adtools / amigaos-cross-toolchain

AmigaOS cross compiler for Linux / MacOSX / Windows
184 stars 48 forks source link

-L during linkage doesn't take preference anymore #67

Open jens-maus opened 7 years ago

jens-maus commented 7 years ago

In previous version of the cross compiler using "-L

" and "-l" during linkage resulted in GCC taking the specified -L as a preference. With your toolchain, however, specifying -L still results in the compiler using its internal linker pathes as preference.

This has the negative effect, that e.g. for our YAM project (https://github.com/jens-maus/yam) our own clib2 replacement libs weren't taken but the global ones from /opt/m68k-amigaos/... which caused some severe trouble since we requiring the thread safe variant of clib2.

See here for the fix we applied recently. https://github.com/jens-maus/yam/commit/941adb5593ba40d97a7598ccfdb32627125fcb3f

It would therefore be a good idea to restore the old behavior in -L command-line options taking preference over the internal ones GCC specified for the c-runtime library used.

jens-maus commented 7 years ago

After some analysis, could it be that this is actually a result of your latest changes to have a -mcrt= option to switch c-runtime libraries? See here:

https://github.com/cahirwpz/amigaos-gcc-2.95.3/blob/ff0d14cc2fa7361db1fb522d4be25a04c18f1765/gcc/config/m68k/amigaos.h#L227

In there you explicitly use -L during linkage yourself and it might be that this always takes preference over user specified -L options afterwards? If this is the case then you would need another solution to specify the linker search path, I guess.