* Telling GCC to add automatically libraries for linking...
@ 2003-08-29 14:46 Serge Cohen
0 siblings, 0 replies; only message in thread
From: Serge Cohen @ 2003-08-29 14:46 UTC (permalink / raw)
To: gcc-help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi;
**** Let me first explain in which context I am:
I'm in the process to build gcc 3.3.1 on an alpha (WITH threads).
After the first build I realised (after 2 days) that any C++ program
should be linked with libpthreads (with s), otherwise the executable
crashes.
I've found a way around that: setting env. variable LIBS to -lpthreads
BEFORE the make command.
Then I wanted to test the compiler, and I discovered that this trick
works perfectly for g++ (only 2 FAIL for 8041 PASS), but I still have
problems making executable from Fortran or Objective-C....
Looking at the test logs, again I found that some libraries should be
added for linking into executable (libthread --without s this time--
for Fortran, and librt and libpthread for Objectvie-C).
I' ve tried the same trick as for libpthreads (adding them to LIBS
before bootstrapping)... but it does not work. Indeed I have tried
before running the configure script.
In the mean time I've check that this is the only problem, by editing
the g77.exp and objc.exp files from the testsuite (so that the proper
libraries are added for every made executable): This yield a perfect
test (No FAIL for g77 --compared to 784 FAIL, 1031 PASS--, and no FAIL
for objc --compared to 500 FAIL, 178 PASS--)
When running the not modified testsuite, the PASS are indeed the
compiling test... any 'executing' test is FAIL.
**** So now my question:
Is their any (proper) way to tell GCC during its building that any time
it'll make executable from a certain type of source, it should add
given library(ies) to the linker call?
Indeed I guess there is, as gcc is adding libfrtbegin to any Fortran
sources when it call ld to link them, so the more interesting question
(implied by the previous) is HOW?
Thanks in advance for any info on that.
Serge.
PS: I've tried to search the gcc lists for this issues, but all my
attempt fell due to bad search motif I guess (much to much answer, most
of them being 'noise' regarding my problem)... so I hope you'll accept
my anticipated apologies if this info can be found on web (or
documentation).
________________________________________________________
Serge COHEN
GPG Key ID: 9CBB58FB
N.K.I.
Department of Molecular Carcinogenesis
Plesmanlaan 121
1066 CX Amsterdam; NL
Offi: + 31 20-512-1957
E-Mail: scohen@nki.nl
________________________________________________________
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (Darwin)
iD8DBQE/T2dI5EPeG5y7WPsRAiYHAKClhHuxHBQpuB91xUW2i7XIzAy63ACfXTRP
fHNAjb9I4N5gyOR/bkq7b7Q=
=DSMp
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-08-29 14:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-29 14:46 Telling GCC to add automatically libraries for linking Serge Cohen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).