Opened 12 years ago

Closed 12 years ago

Last modified 48 years ago

#484 closed bug (Wont Fix)

LDFLAGS not used by generated ghc

Reported by: jgoerzen Owned by: nobody
Priority: normal Milestone:
Component: Compiler Version: None
Keywords: Cc:
Operating System: Architecture:
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:



I specified LDFLAGS=-Wl,-bbigtoc which is needed to
link programs of any size on AIX, including ghc.

The stage1/ghc-inplace compiler, however, is not
passing this along to gcc.

I can manually run the commands that make is running,
add -optl -Wl,-bbigtoc and get the correct result, but
GHC should do this itself.

This is GHC 6.4.1.

Change History (4)

comment:1 Changed 12 years ago by jgoerzen

Logged In: YES 

The final (stage2) compiler also does not honor these flags

comment:2 Changed 12 years ago by simonmar

Status: assignedclosed
Logged In: YES 

Where do you want LDFLAGS to be used?  Just when building
GHC, or do you want them to be added for every link in the
tree?  And when the GHC you're building does any linking itself?

We don't tend to use LDFLAGS/CFLAGS because they're a bit
global, it's not usually what you want.  Instead, you should
modify, something like this:

  GhcStage1HcOpts += -optl-Wl,-bbigtoc

and if you want GHC to always add this option for you, then
the best place to put it is the ld-options field of the rts
package (see ghc/rts/  (also there's
machdepCCOptions in ghc/compiler/main/DynFlags, but that
applies to all C compilations and it's wired into the
compiler, so that's perhaps not as suitable).

comment:3 Changed 12 years ago by jgoerzen

Logged In: YES 

All of the above, really.  I want LDFLAGS to be used when
building ghc, any other tools in the tree, and when GHC does
linking itself.

I'll take a look at the config options you mentioned.  Did I
miss them in the docs somewhere?  If not, could this bug be
considered a request to document this?

comment:4 Changed 12 years ago by simonmar

Logged In: YES 

It sounds like this is just something we need to add to the
source tree for AIX.  If you want -Wl,-bbigtoc always added
to the link line, then adding it to ghc/rts/
is the right thing (add it, test it, send us a patch and
we'll commit).

This isn't really end-user stuff so there isn't
documentation as such. is an
InstalledPackageInfo though, which is documented in

Note: See TracTickets for help on using tickets.