tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: libgcc not built?




> On Apr 1, 2019, at 2:33 PM, Yann Sionneau <yann%sionneau.net@localhost> wrote:
> 
> I successfully followed the steps 1 to 8
> 
> I had to add a few missing parts and to fix some perl issues in gettext
> but it worked pretty well!
> 
> But I'm stuck at step 9 because libc wants to link as a shared library
> and my toolchain does not support shared libraries.

You can do what the sun2 port does.  From src/share./bsd.own.mk:

#
# The m68000 port is incomplete.
#
.if ${MACHINE_ARCH} == "m68000"
NOPIC=          # defined
MKISCSI=        no
# XXX GCC 4 outputs mcount() calling sequences that try to load values
# from over 64KB away and this fails to assemble.
.if defined(HAVE_GCC)
NOPROFILE=      # defined
.endif
.endif


> 
> Can I just generate a static libc.a?
> 
> LDSTATIC=-static MKCRYPTO=no MKLINT=no MKPROFILE=no MKSHARE=no MKRUMP=no
> nbmake-milkymist dependall install MKGCC=no HAVE_GCC=45
> dependall ===> csu
> dependall ===> libc
> #     build  libc/libc.so.12.185
> rm -f libc.so.12.185
> /home/fallen/dev/NetBSD/obj/tooldir.Linux-4.18.0-16-generic-x86_64/bin/lm32--netbsd-gcc
> -nodefaultlibs -Wl,-x -shared -Wl,-soname,libc.so.12
> -Wl,--warn-shared-textrel -Wl,-z,initfirst  
> --sysroot=/home/fallen/dev/NetBSD/obj/destdir.milkymist  -o
> libc.so.12.185  -Wl,-rpath,/lib  -L=/lib  -Wl,--whole-archive
> libc_pic.a  -Wl,--no-whole-archive -lgcc
> /home/fallen/dev/NetBSD/obj/tooldir.Linux-4.18.0-16-generic-x86_64/lib/gcc/lm32--netbsd/4.5.4/../../../../lm32--netbsd/bin/ld:
> -shared not supported
> collect2: ld returned 1 exit status
> 
> *** Failed target:  libc.so.12.185
> 
> Le 01/04/2019 à 21:28, matthew green a écrit :
>>>>> Thanks for your answer :)
>>>>> 
>>>>> Is src/tools/gcc/README.mknative relevant for my cross compilation
>>>>> toolchain?
>>>>> Or only for a *native* (host=lm32 target=lm32) toolchain?
>>>> you need libgcc from somewhere.  typically that comes from
>>>> base netbsd, but for brand new ports with no in-tree help
>>>> it may come from the $EXTERNAL_TOOLCHAIN.  for new ports
>>>> using base gcc, we typically use libgcc built normally,
>>>> but if you don't want a host compiler, MKGCCCMDS=no is
>>>> supported (and default, on eg sun2.)
>>>> 
>>>> which compiler are you using?
>>> I am using the cross compiler built by ./build.sh -m milkymist -u -U tools
>>> 
>>> It seems that when it builds the cross compiler, it does not build the 
>>> libgcc.
>>> 
>>> How am I supposed to make the build system generate libgcc?
>>> 
>>> I use MKGCCCMDS=no when I run the "build" target (./build.sh -m 
>>> milkymist -u -U build).
>>> 
>>> Maybe I should use it also for the "tools" target?
>> see src/tools/gcc/README.mknative.  to get libgcc you'll need
>> to get this working at least minimally.  there is a special
>> bootstrap for just libgcc itself that may still work, but it
>> has been a while since a brand new platform was added.  the
>> readme seems to have most useful details, but let me know if
>> you aren't sure.
>> 
>> you may want to set MKGCCCMDS=no always.  btw, this has no
>> effect on the tools build.  it only affects whether the gcc
>> commands (/usr/bin/gcc etc) are installed or not.
>> 
>> 
>> .mrg.

-- thorpej



Home | Main Index | Thread Index | Old Index