powerpc (non-64) using CROSS_TOOLCHAIN=powerpc64-gcc fails: .TOC. at tocbase notation not recognized

Mark Millard markmi at dsl-only.net
Sat Mar 14 05:43:11 UTC 2015


Basic execution context:

> # freebsd-version -ku; uname -ap
> 11.0-CURRENT
> 11.0-CURRENT
> FreeBSD FBSDG4C0 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r279514M: Mon Mar  9 22:24:27 PDT 2015     root at FBSDG4S0:/usr/obj/usr/srcC/sys/GENERICvtsc-NODEBUG  powerpc powerpc

Attmpted: make -j 8 CROSS_TOOLCHAIN=powerpc64-gcc buildworld buildkernel KERNCONF=GENERIC64vtsc-NODEBUG TARGET=powerPC TARGET_ARCH=powerpc64

> # more /etc/src.conf 
> #CPP=clang-cpp
> #CC=clang
> #CXX=clang++
> #CFLAGS+=-DELF_VERBOSE
> #WITH_DEBUG_FILES=
> WITHOUT_CLANG=
> NO_WERROR=

Note that CROSS_TOOLCHAIN=powerpc64-gcc means the produced files are ELF 64-bit (even if TARGET_ARCH and/or KERNCONF indicates powerpc). I remembered to type GENERIC64vtsc to match. :) I had to explicitly supply TARGET_ARCH=powerpc64 or it would pick TARGET_ARCH=powerpc instead.

WITHOUT_CLANG= avoids various build issues, including lack of any sufficient c++11 library for building clang.

NO_WERROR= avoids stopping for warnings that would prevent the build. I did not figure out any finer grain level of control for a basic experiment.


The problem (something needed else to control configuration?):

...
> --- crti.o ---^M
> gcc -O2 -pipe   -I/usr/srcC/lib/csu/powerpc64/../common  -I/usr/srcC/lib/csu/powerpc64/../../libc/include  -mlongcall -std=gnu99  -Wsystem-headers -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign    -c /usr/srcC/lib/csu/powerpc64/crti.S^M
> ...
> /usr/srcC/lib/csu/powerpc64/crti.S: Assembler messages:^M
> /usr/srcC/lib/csu/powerpc64/crti.S:35: Error: junk at end of line, first unrecognized character is `@'^M
> /usr/srcC/lib/csu/powerpc64/crti.S:51: Error: junk at end of line, first unrecognized character is `@'^M
> *** [crti.o] Error code 1^M
> ^M

(gcc: so the old compiler is used for assembly of sources.)

The lines of crti.S in question are:

>         .quad   .L._init,.TOC. at tocbase,0
> ...
>         .quad   .L._fini,.TOC. at tocbase,0

The crti.S code (starting at the #include) is:

> #include <machine/asm.h>
> __FBSDID("$FreeBSD: head/lib/csu/powerpc64/crti.S 218824 2011-02-18 21:44:53Z nwhitehorn $");
> 
>         .section .init,"ax", at progbits
>         .align  2
>         .globl  _init
>         .section ".opd","aw"
>         .align  3
> _init:
>         .quad   .L._init,.TOC. at tocbase,0
>         .previous
>         .type   _init, at function
> 
>         .align 4
> .L._init:
>         stdu 1,-48(1)
>         mflr 0
>         std 0,64(1)
> 
>         .section .fini,"ax", at progbits
>         .align  2
>         .globl  _fini
>         .section ".opd","aw"
>         .align  3
> _fini:
>         .quad   .L._fini,.TOC. at tocbase,0
>         .previous
>         .type   _fini, at function
> 
>         .align 4
> .L._fini:
>         stdu 1,-48(1)
>         mflr 0
>         std 0,64(1)
> 
>         .section .note.GNU-stack,"",%progbits



Other context details:

> # more /etc/make.conf
> #CPP=clang-cpp
> #CC=clang
> #CXX=clang++
> WRKDIRPREFIX=/usr/obj/portswork
> #WITH_DEBUG=
> MALLOC_PRODUCTION=


> # svnlite info
> Path: .
> Working Copy Root Path: /usr/srcC
> URL: https://svn0.us-west.freebsd.org/base/head
> Relative URL: ^/head
> Repository Root: https://svn0.us-west.freebsd.org/base
> Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
> Revision: 279514
> Node Kind: directory
> Schedule: normal
> Last Changed Author: adrian
> Last Changed Rev: 279514
> Last Changed Date: 2015-03-01 18:27:25 -0800 (Sun, 01 Mar 2015)

> # svnlite info
> Path: .
> Working Copy Root Path: /usr/ports
> URL: https://svn0.us-west.freebsd.org/ports/head
> Relative URL: ^/head
> Repository Root: https://svn0.us-west.freebsd.org/ports
> Repository UUID: 35697150-7ecd-e111-bb59-0022644237b5
> Revision: 380683
> Node Kind: directory
> Schedule: normal
> Last Changed Author: demon
> Last Changed Rev: 380683
> Last Changed Date: 2015-03-07 03:31:11 -0800 (Sat, 07 Mar 2015)


===
Mark Millard
markmi at dsl-only.net



More information about the freebsd-toolchain mailing list