ghc 5.02 and Solaris ld

Akop Pogosian akopps@CSUA.Berkeley.EDU
Tue, 9 Oct 2001 19:54:11 -0700 (PDT)


$ grep 'ld.*-x'  `find . -name Makefile`
./ghc-5.02/ghc/lib/std/Makefile:        ld -r -x -o $@ $(GHCI_LIBOBJS)
./ghc-5.02/ghc/lib/std/Makefile:        ld -r -x -o HSstd1.o $(filter
Prel%, $(GHCI_LIBOBJS))
./ghc-5.02/ghc/lib/std/Makefile:        ld -r -x -o HSstd2.o
$(filter-out Prel%, $(GHCI_LIBOBJS))
./ghc-5.02/hslibs/win32/Makefile:       ld -r -x -o HSwin321.o
$(filter     Win32M% Win32N% Win32R% Win32W%, \
./ghc-5.02/hslibs/win32/Makefile:       ld -r -x -o HSwin322.o
$(filter-out Win32M% Win32N% Win32R% Win32W%, \


It looks like ghc makefiles assume that I am using GNU ld.  The -x
option does not exist in Solaris version of ld.  Is this just a bug or
ghc was not meant to be linked with other versions of ld? Just wondering,
I could always use GNU ld instead (its just not the first thing on my PATH)

According to the SunOS ld manual '-z redlocsym' seems to do what -x does.

     -z redlocsym
                 Eliminates all local symbols except for the SECT
                 symbols  from  the  symbol table SHT_SYMTAB. All
                 relocations that refer to local symbols will  be
                 updated  to refer to the corresponding SECT sym-
                 bol.

So, I'll try to edit the makefiles accordingly and see what happens.


--akop