public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Gcc 3.2 compiler driver bug (?)
@ 2002-09-09 12:13 Sergey Ostrovsky
  2002-09-10  8:04 ` Gcc 3.2 compiler driver bug [UPDATE] Sergey Ostrovsky
  2002-09-10 10:49 ` Gcc 3.2 compiler driver bug (?) Sergey Ostrovsky
  0 siblings, 2 replies; 5+ messages in thread
From: Sergey Ostrovsky @ 2002-09-09 12:13 UTC (permalink / raw)
  To: gcc

Hello,
I've built Gcc 3.2 on Sun Solaris 7. It uses binutils-2.12.1.
The build of

char mkstemps();

int main()
{
  mkstemps();
  return 0;
}

(1)
invoking
gcc -L/sw/sostrovs/99th/lib -liberty test.c
( or gcc -Wl,-L/sw/sostrovs/99th/lib,-liberty test.c )

fails with

/var/tmp//ccWoI2Qs.o: In function `main':
/var/tmp//ccWoI2Qs.o(.text+0x4): undefined reference to `mkstemps'
collect2: ld returned 1 exit status

(2)
invoking
gcc test.c -L/sw/sostrovs/99th/lib -liberty

does the job.

I tried these examples with -v and noticed that "-L/sw/sostrovs/99th/lib
-liberty" thing
just isn't passed to the collect2 in the (1), but is in (2).
gcc --help says
Usage: gcc [options] file...

Please tell me what I did wrong.

Thank you.

Sergey Ostrovsky.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Gcc 3.2 compiler driver bug [UPDATE]
  2002-09-09 12:13 Gcc 3.2 compiler driver bug (?) Sergey Ostrovsky
@ 2002-09-10  8:04 ` Sergey Ostrovsky
  2002-09-10 12:27   ` Russ Allbery
  2002-09-10 10:49 ` Gcc 3.2 compiler driver bug (?) Sergey Ostrovsky
  1 sibling, 1 reply; 5+ messages in thread
From: Sergey Ostrovsky @ 2002-09-10  8:04 UTC (permalink / raw)
  To: Sergey Ostrovsky; +Cc: gcc

Just to make clear I'm talking about important stuff :
when configuring binutils I got

checking for mkstemps... no

Then I re-ran ./confugure with [CPP,LD]FLAGS="-L/sw/sostrovs/99th/lib
-liberty"
It didn't help either. A snippet from
..../binutils-build/libiberty/config.log :

configure:2273: gcc -o conftest -g -O2 -L/sw/sostrovs/99th/lib -liberty
conftest.c  1>&5
/tmp/ccmLf9ow.o: In function `main':
/sw/sostrovs/100th/Build/binutils-build/libiberty/configure:2270: undefined

reference to `mkstemps'
collect2: ld returned 1 exit status
configure: failed program was:

As I figured ( see my previous mail ) linker options given to gcc are
discarded when
used _before_ file name.
Therefore I can't pass parameters to autotools - generated configuration
scripts.

Regards,

Sergey Ostrovsky.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Gcc 3.2 compiler driver bug (?)
  2002-09-09 12:13 Gcc 3.2 compiler driver bug (?) Sergey Ostrovsky
  2002-09-10  8:04 ` Gcc 3.2 compiler driver bug [UPDATE] Sergey Ostrovsky
@ 2002-09-10 10:49 ` Sergey Ostrovsky
  1 sibling, 0 replies; 5+ messages in thread
From: Sergey Ostrovsky @ 2002-09-10 10:49 UTC (permalink / raw)
  To: Sergey Ostrovsky, gcc

Just to clarify the reason why I think it's important :

when configuring binutils I got

checking for mkstemps... no

Then I re-ran ./confugure with [CPP,LD]FLAGS="-L/sw/sostrovs/99th/lib
-liberty"
It didn't help either. A snippet from
..../binutils-build/libiberty/config.log :

configure:2273: gcc -o conftest -g -O2 -L/sw/sostrovs/99th/lib -liberty
conftest.c  1>&5
/tmp/ccmLf9ow.o: In function `main':
/sw/sostrovs/100th/Build/binutils-build/libiberty/configure:2270: undefined

reference to `mkstemps'
collect2: ld returned 1 exit status
configure: failed program was:

As I figured ( see my previous mail ) linker options given to gcc are
discarded when
used _before_ file name.
Therefore I can't pass parameters to autotools - generated configuration
scripts. It's quite a breakage IMO.

Regards,

Sergey Ostrovsky.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Gcc 3.2 compiler driver bug [UPDATE]
  2002-09-10  8:04 ` Gcc 3.2 compiler driver bug [UPDATE] Sergey Ostrovsky
@ 2002-09-10 12:27   ` Russ Allbery
  2002-09-10 13:42     ` Sergey Ostrovsky
  0 siblings, 1 reply; 5+ messages in thread
From: Russ Allbery @ 2002-09-10 12:27 UTC (permalink / raw)
  To: Sergey Ostrovsky; +Cc: gcc

Sergey Ostrovsky <sostrovs@kns.com> writes:

> Just to make clear I'm talking about important stuff :
> when configuring binutils I got

> checking for mkstemps... no

> Then I re-ran ./confugure with [CPP,LD]FLAGS="-L/sw/sostrovs/99th/lib
> -liberty"
> It didn't help either. A snippet from
> ..../binutils-build/libiberty/config.log :

You're using LDFLAGS incorrectly, which is why you're encountering this
problem.  LDFLAGS is *only* for -L flags and similar sorts of things; all
-l flags specifying libraries should be in LIBS instead.

Try ./configure LDFLAGS="-L/sw/sostrovs/99th/lib" LIBS="-liberty".  I
think you'll find that it works much better.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Gcc 3.2 compiler driver bug [UPDATE]
  2002-09-10 12:27   ` Russ Allbery
@ 2002-09-10 13:42     ` Sergey Ostrovsky
  0 siblings, 0 replies; 5+ messages in thread
From: Sergey Ostrovsky @ 2002-09-10 13:42 UTC (permalink / raw)
  To: Russ Allbery; +Cc: Sergey Ostrovsky, gcc

>
> Try ./configure LDFLAGS="-L/sw/sostrovs/99th/lib" LIBS="-liberty".  I
> think you'll find that it works much better.

Thank you very much !
And I'm sorry that this my problem turned out to be  OT for this list.

Sergey.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-09-10 20:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-09 12:13 Gcc 3.2 compiler driver bug (?) Sergey Ostrovsky
2002-09-10  8:04 ` Gcc 3.2 compiler driver bug [UPDATE] Sergey Ostrovsky
2002-09-10 12:27   ` Russ Allbery
2002-09-10 13:42     ` Sergey Ostrovsky
2002-09-10 10:49 ` Gcc 3.2 compiler driver bug (?) Sergey Ostrovsky

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).