Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Oct 2018 15:13:44 -0700
From:      John Baldwin <jhb@FreeBSD.org>
To:        Mark Millard <marklmi@yahoo.com>, FreeBSD Toolchain <freebsd-toolchain@freebsd.org>, FreeBSD PowerPC ML <freebsd-ppc@freebsd.org>
Subject:   Re: base/binutils vs. /usr/local/lib references and also: undefined reference to `pthread_create' (powerpc64 targeting example)
Message-ID:  <3c10995e-2c84-a140-ed4d-449ce61d3d05@FreeBSD.org>
In-Reply-To: <F71D7FCC-801E-498C-8B68-2D25FA55A36A@yahoo.com>
References:  <4C338B84-1179-4569-A964-CA18A22AF1D7@yahoo.com> <F71D7FCC-801E-498C-8B68-2D25FA55A36A@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 10/6/18 12:22 PM, Mark Millard via freebsd-toolchain wrote:
> [Actually devel/gettext-tools is a build time dependency: it should not be using
> libtool: link: /usr/local/bin/powerpc64-unknown-freebsd12.0-gcc --sysroot=. . .
> It looks like the /usr/local/lib references are correct but the wrong linker was
> being used. About 5 other ports have a similar status for making base/binutils
> as a cross build.]

base/binutils should not be pulling in any other ports at all.  Everytime I've
built it it has had no other dependencies beyond pkg.  As far as I'm aware, 
the only ports which work with CROSS_TOOLCHAIN and CROSS_SYSROOT are
ports-mgmt/pkg, base/gcc, and base/binutils.

> On 2018-Oct-5, at 11:00 PM, Mark Millard <marklmi at yahoo.com> wrote:
> 
>> In trying to follow the base/binutils part of https://wiki.freebsd.org/ExternalGCC
>> (or /usr/ports/base/README) for targeting powerpc64 I got:
>>
>> ( My /etc/make.conf has: WRKDIRPREFIX?=/wrkdirs .)
>>
>> # cd ../../base/binutils/
>> # make CROSS_TOOLCHAIN=powerpc64-gcc CROSS_SYSROOT=/usr/obj/DESTDIRs/xtcgcc-powerpc64-installworld package
>> . . .
> 
> Note: This should involve building devel/gettext-tools targetting amd64
> (the host environment in this example) because devel/gettext-tools is
> a build-time dependency, not to be run on the target system.

Maybe install gettext on your system first before doing the build.  Probably
the CROSS_* aren't stripped from the environment when building dependencies.

> May be if devel/gettext-tools had been pre-built and installed
> before trying the CROSS_TOOLCHAIN=powerpc64-gcc
> CROSS_SYSROOT=/usr/obj/DESTDIRs/xtcgcc-powerpc64-installworld
> based build activity it would have been okay?
> 
> [I try such later below and report on the results.]
> 
> There are no words on https://wiki.freebsd.org/ExternalGCC or
> in /usr/ports/base/README for such special build-sequence
> instructions.

You're maybe the 3rd person trying it. :-/

>> (It is also unclear how the process involving base/* mixes with doing
>> later FreeBSD updates from source --including any use of a delete-old
>> step if WITHOUT_BINUTILS= is used at the time. For the cross buildworld
>> itself it is not clear what options are intended.)

So I plan on having a freebsd-gcc.mk (or freebsd-cc.mk) toolchain file
that base/gcc will install that will set WITHOUT_BINUTILS and some other
things.  I have manually done that for now when building world inside a
MIPS qemu instance using base/binutils and base/gcc as the native toolchain.
Once I have a build that actually finishes I plan to add the toolchain to
the port and then have Makefile.inc1 automatically include the file it is
present.

>> Notes about some typos on: https://wiki.freebsd.org/ExternalGCC
>>
>> /usr/ports/devel/ports-mgmt/pkg should be:
>> /usr/ports/ports-mgmt/pkg
>>
>> 3 examples of CROSS_TOOCLAHIN should be:
>> CROSS_TOOLCHAIN

Fixed.

>> Notes about the /usr/ports/base/README :
>>
>> No mention is made of the pkg build so that it can be
>> set up on the target. Only https://wiki.freebsd.org/ExternalGCC
>> has that information. /usr/ports/base/README does not
>> reference https://wiki.freebsd.org/ExternalGCC either.

The README predates the wiki page by a fair bit.

The current known issue I need to get back to with base/gcc is that it
improperly looks for libraries in /usr/lib when --sysroot is used.  I need
to get that fixed so that a buildworld via base/gcc works correctly and then
I will probably get back to working on more of the todo items on the wiki
page.

-- 
John Baldwin

                                                                            



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3c10995e-2c84-a140-ed4d-449ce61d3d05>