git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 4/4] Makefile: Don't pass $(ALL_CFLAGS) to the linker

From
Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Date
Jun 30, 2010, 19:40 UTC
Message-ID
<4C2B9DA7.9000902@ramsay1.demon.co.uk>
In-Reply-To
<20100626181945.GA13070@burratino>
Jonathan Nieder wrote:
> That does make sense.  Perhaps “traditionally” was not the right word;
> I was just looking at common practice.  I’ve just never seen -O put
> into LDFLAGS, for example, and I think most people would expect
> setting CFLAGS=-O0 to affect the linker, too.

[This is now a bit off-topic, see below, but what version of gcc are you using that passes -O to the linker (well, collect2 anyway)? Do you have to pass -flto? For example "gcc -v -g -O2 hello.o -o hello" seems to show (for both gcc 3.4.4 and gcc 4.4.0) that neither -g or -O2 is passed to collect2.

Hmmm, the output from gcc 4.4.0 adds a line like:
    COLLECT_GCC_OPTIONS='-v' '-g' '-O2' '-o' 'hello.exe' '-mtune=i386'
so, does this imply this is a env. var exported to collect2?
dunno ;-P ]
> I suspect the problem comes from my unfamiliarity with MSVC.
Heh, I'm not an expert user of msvc either!
> Maybe clink.pl should use “cl.exe /link” instead of “link.exe” and this
> problem would go away.

I tried this *very* quickly and it didn't work. (It's quite possible that I could spend some time and get it to work, but ...)

The patch that Peter sent seems like the way to go, since it does not affect the regular (non-msvc) build - and it works! ;-)

So we can drop this patch. Thanks for your time.

ATB, Ramsay Jones

Previous: Jonathan NiederNext: Andreas Schwab
Message 5 of 12 in “Makefile: Don't pass $(ALL_CFLAGS) to the linker”
  1. 4/4 Makefile: Don't pass $(ALL_CFLAGS) to the linkerRamsay Jones, Jun 23, 2010
  2. Jonathan NiederJun 23, 2010
  3. Ramsay JonesJun 26, 2010
  4. Jonathan NiederJun 26, 2010
  5. Ramsay JonesJun 30, 2010
  6. Andreas SchwabJun 30, 2010
  7. Bernhard R. LinkJun 27, 2010
  8. Peter HarrisJun 24, 2010
  9. Ramsay JonesJun 25, 2010
  10. Peter HarrisJun 27, 2010
  11. Ramsay JonesJun 30, 2010
  12. Peter HarrisJul 1, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.