Mark Martin wrote:
> On 10/14/07, *Mark Martin* <storycrafter at gmail.com 
> <mailto:storycrafter at gmail.com>> wrote:
>
>     On 10/14/07, *Brian D. Horn* <Brian.Horn at sun.com
>     <mailto:Brian.Horn at sun.com>> wrote:
>
>         Yes.  The thing is that we hadn't been rebuilding the linker
>         since we
>         had it working properly
>         for building the boot and kernel, since we were not up to
>         application
>         code.  When, recently,
>         we started building application code ( libc.so.1 and such) I
>         found that
>         there was a bug in the
>         linker (ld).  I went to fix that bug and cam across this
>         error.  It has
>         to do with the -W0,globalstatic option, but
>         I need to investigate a bit more to find out when and how this
>         problem
>         game into being.
>
>
>
>     Righto.  It was in the Makefile.master all along..
>     # When -g is used, the compiler globalizes static objects
>     # (gives them a unique prefix). Disable that.
>     CNOGLOBAL= -W0,-noglobal
>
>     # Direct the Sun Studio compiler to use a static globalization
>     prefix based on the
>     # name of the module rather than something unique. Otherwise, objects
>     # will not build deterministically, as subsequent compilations of
>     identical
>     # source will yeild objects that always look different.
>     #
>     # In the same spirit, this will also remove the date from the
>     N_OPT stab.
>     CGLOBALSTATIC= -W0,-xglobalstatic
>
>     I was missing CNOGLOBAL in CFLAGS (which may not be the correct
>     place, but moves me past that error and on to new ones :)  Learned
>     something new: -g forces global scope (which does make some sense).
>
>     Thanks for the tip.  I do realize it may still be an issue in
>     general, so I look forward to what you come up with...
>
>     Mark
>
>
>
> In the meantime, I pushed through and got a cross LD working.  
> Allegedly, it generates 32-bit big-endian PPC elf outputs...
>
> bash-3.00$ 
> /home/mark/opensolaris/polaris/ppc-dev/proto/root_ppc/usr/ccs/bin/elfdump 
> -e usr/src/uts/ppc/devinfo/obj32/devinfo
>
> ELF Header
>   ei_magic:   { 0x7f, E, L, F }
>   ei_class:   ELFCLASS32          ei_data:      ELFDATA2MSB
>   e_machine:  EM_PPC              e_version:    EV_CURRENT
>   e_type:     ET_REL
>   e_flags:                     0
>   e_entry:                     0  e_ehsize:     52  e_shstrndx:  9
>   e_shoff:               0x127a8  e_shentsize:  40  e_shnum:     14
>   e_phoff:                     0  e_phentsize:   0  e_phnum:     0
>
> bash-3.00$ uname -a
> SunOS isildur 5.11 snv_73 sun4u sparc SUNW,Sun-Blade-1000
>
> Unfortunately, genunix builds are stuck on...
> Current working directory 
> /home/mark/opensolaris/polaris/ppc-dev/usr/src/uts/ppc/genunix
> isildur --> Job output
> /opt/onbld/bin/ppc/cw -_gcc -g -gdwarf-2   -D__powerpc -U__i386 
> -D__powerpc32 -W0,-noglobal  ..
> /../ppc/ml/ppc32.il -D_ASM_INLINES -Xa   -_gcc=-ffreestanding -v 
> -xildoff   -xdebugformat=stabs
>   -W0,-xglobalstatic  -D_KERNEL -D_SYSCALL32 -D_DDI_STRICT  
> -DC2_AUDIT    -I../../ppc -Y I,../.
> ./common  -I/home/mark/opensolaris/polaris/ppc-dev/usr/src/common -c 
> -o obj32/exit.o ../../comm
> on/os/exit.c
> + /opt/polaris/powerpc- unknown-solaris2.11/bin/gcc -fident -finline 
> -fno-inline-functions -fno-
> builtin -fno-asm -nodefaultlibs -D__sun -gdwarf-2 -gdwarf-2 
> -D__powerpc -U__i386 -D__powerpc32
> -D_ASM_INLINES -ffreestanding -Wall -Wno-unknown-pragmas 
> -Wno-missing-braces -Wno-sign-compare
> -Wno-parentheses -Wno-uninitialized -Wno-implicit-function-declaration 
> -Wno-unused -Wno-trigrap
> hs -Wno-char-subscripts -Wno-switch -D_KERNEL -ffreestanding 
> -D_SYSCALL32 -D_DDI_STRICT -DC2_AU
> DIT -I../../ppc -nostdinc -I../../common 
> -I/home/mark/opensolaris/polaris/ppc-dev/usr/src/commo
> n -c -o obj32/exit.o ../../common/os/exit.c
> In file included from ../../common/sys/brand.h:36,
>                  from ../../common/os/exit.c:76:
> ../../common/sys/exec.h:73: error: array type has incomplete element type
> *** Error code 1
> dmake: Warning: Command failed for target `obj32/exit.o'
>
> I do realize I'm probably cluttering the list so I'll take this to a 
> blog somewhere from here on out if anyone is still interested.

Although I haven't looked at the details here, I note the fact that 
there is a -U__i386 which is probably needed
due to the fact that under some circumstances __i386 is being predefined 
by the compiler, but you may
need -U__sparc (or something similar).
>
> Mark
>
>
>     -- 
>     ------------------------------------------------------
>     Born to the false world, the wanderer,
>     Storyteller, The Pied Piper
>     On a quest for immortality
>     Gathering a troop to find the fantasy
>     -- Nightwish
>
>
>
>
> -- 
> ------------------------------------------------------
> Born to the false world, the wanderer,
> Storyteller, The Pied Piper
> On a quest for immortality
> Gathering a troop to find the fantasy
> -- Nightwish 


Reply via email to