How to change gcc from clang at build kernel and world?

Mori Hiroki yamori813 at yahoo.co.jp
Sat Jul 9 22:39:53 UTC 2016


Thanks reply.

I still have error.


I have question. Is armv4(cns11xx) support on 11R ?

--------------------------------------------------------------
>>> stage 4.2: building libraries
--------------------------------------------------------------
cd /storage/home/hiroki/freebsd;  MAKEOBJDIRPREFIX=/storage/home/hiroki/obj//sto
rage/home/hiroki/zrouter/tmp//arm.arm  MACHINE_ARCH=arm  MACHINE=arm  CPUTYPE= G
ROFF_BIN_PATH=/storage/home/hiroki/obj//storage/home/hiroki/zrouter/tmp//arm.arm
/storage/home/hiroki/freebsd/tmp/legacy/usr/bin  GROFF_FONT_PATH=/storage/home/h
iroki/obj//storage/home/hiroki/zrouter/tmp//arm.arm/storage/home/hiroki/freebsd/
tmp/legacy/usr/share/groff_font  GROFF_TMAC_PATH=/storage/home/hiroki/obj//stora
ge/home/hiroki/zrouter/tmp//arm.arm/storage/home/hiroki/freebsd/tmp/legacy/usr/s
hare/tmac CC="cc " CXX="c++  "  CPP="cpp "  AS="as" AR="ar" LD="ld" NM=nm  OBJDU
MP=objdump OBJCOPY="objcopy"  RANLIB=ranlib STRINGS=  SIZE="size"  INSTALL="sh /
storage/home/hiroki/freebsd/tools/install.sh"  PATH=/storage/home/hiroki/obj//st
orage/home/hiroki/zrouter/tmp//arm.arm/storage/home/hiroki/freebsd/tmp/legacy/us
r/sbin:/storage/home/hiroki/obj//storage/home/hiroki/zrouter/tmp//arm.arm/storag
e/home/hiroki/freebsd/tmp/legacy/usr/bin:/storage/home/hiroki/obj//storage/home/
hiroki/zrouter/tmp//arm.arm/storage/home/hiroki/freebsd/tmp/legacy/bin:/storage/
home/hiroki/obj//storage/home/hiroki/zrouter/tmp//arm.arm/storage/home/hiroki/fr
eebsd/tmp/usr/sbin:/storage/home/hiroki/obj//storage/home/hiroki/zrouter/tmp//ar
m.arm/storage/home/hiroki/freebsd/tmp/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin /sto
rage/home/hiroki/obj//storage/home/hiroki/zrouter/tmp//storage/home/hiroki/freeb
sd/make.amd64/bmake  -f Makefile.inc1 DESTDIR=/storage/home/hiroki/obj//storage/
home/hiroki/zrouter/tmp//arm.arm/storage/home/hiroki/freebsd/tmp -DNO_FSCHG MK_H
TML=no -DNO_LINT MK_MAN=no  MK_PROFILE=no MK_TESTS=no MK_TESTS_SUPPORT=yes libra
ries
cd /storage/home/hiroki/freebsd;  /storage/home/hiroki/obj//storage/home/hiroki/
zrouter/tmp//storage/home/hiroki/freebsd/make.amd64/bmake -f Makefile.inc1 _prer
eq_libs;  /storage/home/hiroki/obj//storage/home/hiroki/zrouter/tmp//storage/hom
e/hiroki/freebsd/make.amd64/bmake -f Makefile.inc1 _startup_libs;  /storage/home
/hiroki/obj//storage/home/hiroki/zrouter/tmp//storage/home/hiroki/freebsd/make.a
md64/bmake -f Makefile.inc1 _prebuild_libs;  /storage/home/hiroki/obj//storage/h
ome/hiroki/zrouter/tmp//storage/home/hiroki/freebsd/make.amd64/bmake -f Makefile
.inc1 _generic_libs
===> gnu/lib/libssp/libssp_nonshared (obj,all,install)
cc   -O -pipe -DHAVE_CONFIG_H -I/storage/home/hiroki/freebsd/gnu/lib/libssp/libs
sp_nonshared/..  -I/storage/home/hiroki/freebsd/gnu/lib/libssp/libssp_nonshared/
../../../../contrib/gcclibs/libssp  -I/storage/home/hiroki/freebsd/gnu/lib/libss
p/libssp_nonshared/../../../../contrib/gcclibs/include -fPIC -DPIC -fvisibility=
hidden   -MD  -MF.depend.ssp-local.o -MTssp-local.o -std=gnu99    -Qunused-argum
ents  -c /storage/home/hiroki/freebsd/gnu/lib/libssp/libssp_nonshared/../../../.
./contrib/gcclibs/libssp/ssp-local.c -o ssp-local.o
building static ssp_nonshared library
ar -crD libssp_nonshared.a `NM='nm' NMFLAGS='' lorder ssp-local.o  | tsort -q` 
ranlib -D libssp_nonshared.a
sh /storage/home/hiroki/freebsd/tools/install.sh  -C -o root -g wheel -m 444   l
ibssp_nonshared.a /storage/home/hiroki/obj//storage/home/hiroki/zrouter/tmp//arm
.arm/storage/home/hiroki/freebsd/tmp/usr/lib/
===> gnu/lib/libgcc (obj,all,install)
TARGET_CPU_DEFAULT=""  HEADERS="options.h dbxelf.h elfos-undef.h elfos.h freebsd
-native.h freebsd-spec.h freebsd.h arm/elf.h arm/aout.h arm/bpabi.h arm/freebsd.
h arm/arm.h defaults.h"  DEFINES=""  /bin/sh /storage/home/hiroki/freebsd/gnu/li
b/libgcc/../../../contrib/gcc/mkconfig.sh tm.h
echo '#define EXTRA_MODES_FILE "arm/arm-modes.def"' >> tm.h
TARGET_CPU_DEFAULT=""  HEADERS="auto-host.h ansidecl.h"  DEFINES="USED_FOR_TARGE
T"  /bin/sh /storage/home/hiroki/freebsd/gnu/lib/libgcc/../../../contrib/gcc/mkc
onfig.sh tconfig.h
LC_ALL=C awk -f /storage/home/hiroki/freebsd/gnu/lib/libgcc/../../../contrib/gcc
/opt-gather.awk /storage/home/hiroki/freebsd/gnu/lib/libgcc/../../../contrib/gcc
/c.opt /storage/home/hiroki/freebsd/gnu/lib/libgcc/../../../contrib/gcc/common.o
pt /storage/home/hiroki/freebsd/gnu/lib/libgcc/../../../contrib/gcc/config/arm/a
rm.opt > optionlist
LC_ALL=C awk -f /storage/home/hiroki/freebsd/gnu/lib/libgcc/../../../contrib/gcc
/opt-functions.awk  -f /storage/home/hiroki/freebsd/gnu/lib/libgcc/../../../cont
rib/gcc/opth-gen.awk  < optionlist > options.h
ln -sf /storage/home/hiroki/freebsd/gnu/lib/libgcc/../../../contrib/gcc/gthr-pos
ix.h gthr-default.h
ln -sf /storage/home/hiroki/freebsd/gnu/lib/libgcc/../../../contrib/gcc/config/a
rm/unwind-arm.h unwind.h
cc  -c -O -pipe   -DTARGET_ARM_EABI -DIN_GCC -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEED
ED  -DHAVE_GTHR_DEFAULT  -I/storage/home/hiroki/freebsd/gnu/lib/libgcc/../../../
contrib/gcclibs/include  -I/storage/home/hiroki/freebsd/gnu/lib/libgcc/../../../
contrib/gcc/config -I/storage/home/hiroki/freebsd/gnu/lib/libgcc/../../../contri
b/gcc -I.  -I/storage/home/hiroki/freebsd/gnu/lib/libgcc/../../usr.bin/cc/cc_too
ls -Dinhibit_libc -fno-inline -std=gnu99    -fheinous-gnu-extensions -Qunused-ar
guments  -fvisibility=hidden -DHIDE_EXPORTS -fPIC -fexceptions -D__GLIBC__=3 -DE
lfW=__ElfN -o unwind-arm.o /storage/home/hiroki/freebsd/gnu/lib/libgcc/../../../
contrib/gcc/config/arm/unwind-arm.c
cc -O -pipe   -DTARGET_ARM_EABI -DIN_GCC -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  
-DHAVE_GTHR_DEFAULT  -I/storage/home/hiroki/freebsd/gnu/lib/libgcc/../../../cont
rib/gcclibs/include  -I/storage/home/hiroki/freebsd/gnu/lib/libgcc/../../../cont
rib/gcc/config -I/storage/home/hiroki/freebsd/gnu/lib/libgcc/../../../contrib/gc
c -I.  -I/storage/home/hiroki/freebsd/gnu/lib/libgcc/../../usr.bin/cc/cc_tools -
Dinhibit_libc -fno-inline -std=gnu99    -fheinous-gnu-extensions -Qunused-argume
nts    -c /storage/home/hiroki/freebsd/gnu/lib/libgcc/../../../contrib/gcc/confi
g/arm/libunwind.S -o libunwind.o
/storage/home/hiroki/freebsd/gnu/lib/libgcc/../../../contrib/gcc/config/arm/libu
nwind.S:29:10: fatal error: 
      'machine/acle-compat.h' file not found
#include <machine/acle-compat.h>
         ^
1 error generated.
*** Error code 1

Stop.
bmake[5]: stopped in /storage/home/hiroki/freebsd/gnu/lib/libgcc
*** Error code 1

Stop.
bmake[4]: stopped in /storage/home/hiroki/freebsd
*** Error code 1



----- Original Message -----
>From: Warner Losh <wlosh at bsdimp.com>
>To: Mori Hiroki <yamori813 at yahoo.co.jp> 
>Cc: "freebsd-arm at freebsd.org" <freebsd-arm at freebsd.org>
>Date: 2016/7/10, Sun 05:16
>Subject: Re: How to change gcc from clang at build kernel and world?
> 
>CPUTYPE=armv4 isn’t going to work. Remove that line from your make.conf.
>
>Warner
>
>> On Jul 9, 2016, at 10:39 AM, Mori Hiroki <yamori813 at yahoo.co.jp> wrote:
>> 
>> Thanks advice.
>> 
>> 
>> I try to build on this options at two week before head source. I have as follow error...
>> 
>> --------------------------------------------------------------
>>>>> stage 4.2: building libraries
>> --------------------------------------------------------------
>> cd /storage/home/hiroki/freebsd;  MAKEOBJDIRPREFIX=/storage/home/hiroki/obj//sto
>> rage/home/hiroki/zrouter/tmp//arm.arm  MACHINE_ARCH=arm  MACHINE=arm  CPUTYPE=ar
>> mv4 GROFF_BIN_PATH=/storage/home/hiroki/obj//storage/home/hiroki/zrouter/tmp//ar
>> m.arm/storage/home/hiroki/freebsd/tmp/legacy/usr/bin  GROFF_FONT_PATH=/storage/h
>> ome/hiroki/obj//storage/home/hiroki/zrouter/tmp//arm.arm/storage/home/hiroki/fre
>> ebsd/tmp/legacy/usr/share/groff_font  GROFF_TMAC_PATH=/storage/home/hiroki/obj//
>> storage/home/hiroki/zrouter/tmp//arm.arm/storage/home/hiroki/freebsd/tmp/legacy/
>> usr/share/tmac CC="cc " CXX="c++  "  CPP="cpp "  AS="as" AR="ar" LD="ld" NM=nm  
>> OBJDUMP=objdump OBJCOPY="objcopy"  RANLIB=ranlib STRINGS=  SIZE="size"  INSTALL=
>> "sh /storage/home/hiroki/freebsd/tools/install.sh"  PATH=/storage/home/hiroki/ob
>> j//storage/home/hiroki/zrouter/tmp//arm.arm/storage/home/hiroki/freebsd/tmp/lega
>> cy/usr/sbin:/storage/home/hiroki/obj//storage/home/hiroki/zrouter/tmp//arm.arm/s
>> torage/home/hiroki/freebsd/tmp/legacy/usr/bin:/storage/home/hiroki/obj//storage/
>> home/hiroki/zrouter/tmp//arm.arm/storage/home/hiroki/freebsd/tmp/legacy/bin:/sto
>> rage/home/hiroki/obj//storage/home/hiroki/zrouter/tmp//arm.arm/storage/home/hiro
>> ki/freebsd/tmp/usr/sbin:/storage/home/hiroki/obj//storage/home/hiroki/zrouter/tm
>> p//arm.arm/storage/home/hiroki/freebsd/tmp/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin
>>  /storage/home/hiroki/obj//storage/home/hiroki/zrouter/tmp//storage/home/hiroki/
>> freebsd/make.amd64/bmake  -f Makefile.inc1 DESTDIR=/storage/home/hiroki/obj//sto
>> rage/home/hiroki/zrouter/tmp//arm.arm/storage/home/hiroki/freebsd/tmp -DNO_FSCHG
>>  MK_HTML=no -DNO_LINT MK_MAN=no  MK_PROFILE=no MK_TESTS=no MK_TESTS_SUPPORT=yes 
>> libraries
>> cd /storage/home/hiroki/freebsd;  /storage/home/hiroki/obj//storage/home/hiroki/
>> zrouter/tmp//storage/home/hiroki/freebsd/make.amd64/bmake -f Makefile.inc1 _prer
>> eq_libs;  /storage/home/hiroki/obj//storage/home/hiroki/zrouter/tmp//storage/hom
>> e/hiroki/freebsd/make.amd64/bmake -f Makefile.inc1 _startup_libs;  /storage/home
>> /hiroki/obj//storage/home/hiroki/zrouter/tmp//storage/home/hiroki/freebsd/make.a
>> md64/bmake -f Makefile.inc1 _prebuild_libs;  /storage/home/hiroki/obj//storage/h
>> ome/hiroki/zrouter/tmp//storage/home/hiroki/freebsd/make.amd64/bmake -f Makefile
>> .inc1 _generic_libs
>> ===> gnu/lib/libssp/libssp_nonshared (obj,all,install)
>> cc   -O -pipe -DHAVE_CONFIG_H -I/storage/home/hiroki/freebsd/gnu/lib/libssp/libs
>> sp_nonshared/..  -I/storage/home/hiroki/freebsd/gnu/lib/libssp/libssp_nonshared/
>> ../../../../contrib/gcclibs/libssp  -I/storage/home/hiroki/freebsd/gnu/lib/libss
>> p/libssp_nonshared/../../../../contrib/gcclibs/include -fPIC -DPIC -fvisibility=
>> hidden -march=armv4  -MD  -MF.depend.ssp-local.o -MTssp-local.o -std=gnu99    -Q
>> unused-arguments  -c /storage/home/hiroki/freebsd/gnu/lib/libssp/libssp_nonshare
>> d/../../../../contrib/gcclibs/libssp/ssp-local.c -o ssp-local.o
>> error: unknown target CPU 'armv4'
>> *** Error code 1
>> 
>> Stop.
>> bmake[5]: stopped in /storage/home/hiroki/freebsd/gnu/lib/libssp/libssp_nonshare
>> d
>> *** Error code 1
>> 
>> Stop.
>> bmake[4]: stopped in /storage/home/hiroki/freebsd
>> *** Error code 1
>> 
>> Stop.
>> bmake[3]: stopped in /storage/home/hiroki/freebsd
>> *** Error code 1
>> 
>> Stop.
>> bmake[2]: stopped in /storage/home/hiroki/freebsd
>> *** Error code 1
>> 
>> Stop.
>> make[1]: stopped in /storage/home/hiroki/freebsd
>> *** Error code 1
>> 
>> Stop.
>> make: stopped in /storage/home/hiroki/zrouter
>> 
>> 
>> 
>> ----- Original Message -----
>>> From: Warner Losh <imp at bsdimp.com>
>>> To: Mori Hiroki <yamori813 at yahoo.co.jp> 
>>> Cc: "freebsd-arm at freebsd.org" <freebsd-arm at freebsd.org>
>>> Date: 2016/7/5, Tue 00:31
>>> Subject: Re: How to change gcc from clang at build kernel and world?
>>> 
>>> You should be able to get the build with
>>> WITH_GCC_BOOTSTRAP=YES WITH_GCC=YES WITHOUT_CLANG_BOOTSTRAP=YES and
>>> WITHOUT_CLANG=YES
>>> 
>>> There's also supposed to be a command line arg to clang to keep it
>>> from using bx instructions. So that's messed up.
>>> 
>>> But if the compiler-rt stuff, which I haven't looked at, has a naked
>>> bx instruction, we'll need an ifdef.
>>> 
>>> Warner
>>> 
>>> On Sun, Jul 3, 2016 at 6:46 PM, Mori Hiroki <yamori813 at yahoo.co.jp> wrote:
>>>> Hi.
>>>> 
>>>> I make support Eventtimer and FDT and INTRNG to cns11xx code.
>>>> 
>>>> This is almost done. But hang up at init. I think it's a interrupt issue.
>>>> 
>>>> https://gist.github.com/yamori813/ae047a28a825aac255e436fd8ccaf785
>>>> 
>>>> 
>>>> https://github.com/yamori813/freebsd/tree/zrouter/sys/arm/cavium/cns11xx
>>>> 
>>>> 
>>>> cns11xx is arm4(not arm4t).  arm build on head is change to use clang
>>>> several month ago. I want use gcc at buildworld and buildkernel.
>>>> 
>>>> Because of clang use bx instruction. bx instruction not support arm4.
>>>> 
>>>> How do I change to gcc from clang?
>>>> 
>>>> I found bx instruction at
>>>> 
>>>> contrib/compiler-rt/lib/builtins/arm/
>>>> 
>>>> It must be changed bx to mov instruction.
>>>> 
>>>> Regards.
>>>> 
>>>> Hiroki Mori
>>>> _______________________________________________
>>>> freebsd-arm at freebsd.org mailing list
>>>> https://lists.freebsd.org/mailman/listinfo/freebsd-arm
>>>> To unsubscribe, send any mail to "freebsd-arm-unsubscribe at freebsd.org"
>>> 
>>> 
>>> 
>> _______________________________________________
>> freebsd-arm at freebsd.org mailing list
>> https://lists.freebsd.org/mailman/listinfo/freebsd-arm
>> To unsubscribe, send any mail to "freebsd-arm-unsubscribe at freebsd.org"
>
>
>
>


More information about the freebsd-arm mailing list