Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#3863 closed bug (fixed)

Absolute paths to GCC and perl should not be baked into the compiler.

Reported by: benl Owned by: igloo
Priority: high Milestone: 7.0.1
Component: Build System Version: 6.13
Keywords: Cc: Christian.Maeder@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time crash Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

Building with sh boot ; ./configure ; make leaves me with the following lines in compiler/main/Config.hs

cGCC                  = "/export/home/benl/software/gcc-4.1.2/bin/gcc"
cGHC_PERL             = "/opt/csw/bin/perl"

These absolute paths are baked into the compiler, and if I then do a make binary-dist the resulting binary distribution is unusable for anyone else.

Note that compiler/main/SysTools.hs:105 says that these vars should not include paths, and rightly so. I'm currently working around this by hacking mk/config.mk after running ./configure.

We probably need a better story about which GCC and perl to use for the build, vs which ones to use when compiling programs. I vote that the default should be to use the ones in the PATH unless explicitly configured not to.

Note that on SPARC/Solaris the default system GCC is unusable, so people that do not have root access will always need to run GHC against a privately installed GCC.

Tickets #2966 and #3842 are related.

Change History (8)

comment:1 Changed 8 years ago by maeder

Cc: Christian.Maeder@… added
Type of failure: Installing GHC failedCompile-time crash

comment:2 Changed 8 years ago by igloo

Milestone: 6.12.2
Priority: normalhigh

comment:3 Changed 8 years ago by igloo

Owner: set to igloo

comment:4 Changed 8 years ago by igloo

Resolution: fixed
Status: newclosed

Now fixed in HEAD and 6.12:

Wed Mar 24 10:14:08 PDT 2010  Ian Lynagh <igloo@earth.li>
  * Pass the location of gcc in the ghc wrapper script; partially fixes #3863
  This means we don't rely on baking a path to gcc into the executable

Wed Mar 24 10:14:22 PDT 2010  Ian Lynagh <igloo@earth.li>
  * Change how perl scripts get installed; partially fixes #3863
  We now regenerate them when installing, which means the path for perl
  doesn't get baked in

comment:5 Changed 7 years ago by maeder

Owner: igloo deleted
Resolution: fixed
Status: closednew

I've just build a binary dist http://www.informatik.uni-bremen.de/agbkb/forschung/formal_methods/CoFI/hets/solaris/ghcs/ghc-6.12.3-sparc-sun-solaris2.tar.bz2 that still has my gcc namely /opt/csw/gcc4/bin/gcc baked in. The scripts only set "pgmc", but gcc is used for the preprocessor, assembler and linker, too.

I had to add

-pgmP "gcc -E" -pgml gcc -pgma gcc -pgmc gcc 

to the ghc executable.

comment:6 Changed 7 years ago by igloo

Milestone: 6.12.26.14.1
Owner: set to igloo

comment:7 Changed 7 years ago by igloo

Resolution: fixed
Status: newclosed

Thanks for the report; fixed:

Fri Aug 27 21:45:37 BST 2010  Ian Lynagh <igloo@earth.li>
  * Pass more -pgm flags in the ghc wrapper; fixes #3863

comment:8 Changed 7 years ago by maeder

I think so proper preprocessor flags are:

-pgmP "gcc -E -undef -traditional"

I wonder why you still put a full path inside the ghc binary instead of changing this to the base name or omitting it entirely and relying on flags set.

Note: See TracTickets for help on using tickets.