Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 03 Feb 2018 20:46:57 +0000
From:      bugzilla-noreply@freebsd.org
To:        pkg@FreeBSD.org
Subject:   [Bug 224217] [patch] Fix cross build of base/ ports
Message-ID:  <bug-224217-32340-Ee0JCYc41c@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-224217-32340@https.bugs.freebsd.org/bugzilla/>
References:  <bug-224217-32340@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D224217

--- Comment #14 from Mark Millard <marklmi26-fbsd@yahoo.com> ---
(In reply to Steve Wills from comment #12)

Context:

# uname -apKU
FreeBSD FBSDFSSD 12.0-CURRENT FreeBSD 12.0-CURRENT  r327485M  amd64 amd64
1200054 1200054

with cross build attempted for targeting powerpc64.

base/binutils did not build once I got needed tools in place.
This stage is tied to the README's:

4/ build the required port
$ cd base/binutils
make CROSS_TOOLCHAIN=3Dsparc64-gcc CROSS_SYSROOT=3D/sysroots/sparc64 package

(but with powerpc64-gcc and my cross-sysroot path).


Summary of failures:

I had to install devel/bison and devel/gmake to even get
started. devel/powerpc64-xtoolchain-gcc is insufficient.
(I had it installed already.)

It then looked for powerpc64-unknown-freebsd12.0-ar but
no such exists. Instead there is:

/usr/local/bin/powerpc64-unknown-freebsd12.0-gcc-ar

which is from:

# pkg which /usr/local/bin/powerpc64-unknown-freebsd12.0-gcc-ar
/usr/local/bin/powerpc64-unknown-freebsd12.0-gcc-ar was installed by package
powerpc64-gcc-6.3.0


With that I stopped instead of providing a workaround
this time.


Detail steps/sequence for as far as I got:

I used a pre-existing installworld :

/usr/obj/DESTDIRs/clang-powerpc64-installworld_altbinutils/

from having built with the system clang and devel/powerpc64-binutils
instead of with gcc 4.2.1 . (I normally experiment with clang
based targeting for powerpc64 and powerpc.)

I reverted /usr/ports/base and then applied the patch. So:

# svnlite status /usr/ports/base | sort
M       /usr/ports/base/gcc/Makefile
M       /usr/ports/base/gcc/distinfo
M       /usr/ports/base/gcc/pkg-plist

became:

# svnlite status /usr/ports/base/
M       /usr/ports/base/binutils/Makefile
M       /usr/ports/base/gcc/Makefile
M       /usr/ports/base/gcc/distinfo
?       /usr/ports/base/gcc/files/patch-Makefile.in
?       /usr/ports/base/gcc/files/patch-gcc-Makefile.in
?       /usr/ports/base/gcc/files/patch-gcc-configure
M       /usr/ports/base/gcc/pkg-plist

For reference:

# pkg info "powerpc64*"
powerpc64-binutils-2.29.1,1
powerpc64-gcc-6.3.0
powerpc64-xtoolchain-gcc-0.2

I then:

# make CROSS_TOOLCHAIN=3Dpowerpc64-gcc
CROSS_SYSROOT=3D/usr/obj/DESTDIRs/clang-powerpc64-installworld_altbinutils
package

I left RELRO and STATIC unchecked.

The result was:

=3D=3D=3D>  License GPLv3 LGPL3 accepted by the user
=3D=3D=3D>   freebsd-binutils-2.29.1 depends on file: /usr/local/sbin/pkg -=
 found
=3D=3D=3D> Fetching all distfiles required by freebsd-binutils-2.29.1 for b=
uilding
=3D=3D=3D>  Extracting for freebsd-binutils-2.29.1
=3D> SHA256 Checksum OK for binutils-2.29.1.tar.bz2.
=3D=3D=3D>  Patching for freebsd-binutils-2.29.1
=3D=3D=3D>  Applying FreeBSD patches for freebsd-binutils-2.29.1
/usr/bin/sed -i.bak -e "s/-ldl//g"
/wrkdirs/usr/ports/base/binutils/work/binutils-2.29.1/gold/testsuite/Makefi=
le.in
=3D=3D=3D>   freebsd-binutils-2.29.1 depends on executable: bison - not fou=
nd
=3D=3D=3D>   freebsd-binutils-2.29.1 depends on executable: bison - not fou=
nd
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/base/binutils
*** Error code 1

Stop.
make: stopped in /usr/ports/base/binutils

Nothing in the README indicated to have bison ready first.

So. . .

# pkg install bison

Trying again. . .

Similar sequence for gmake:

# pkg install gmake

Finally . . .

# make CROSS_TOOLCHAIN=3Dpowerpc64-gcc
CROSS_SYSROOT=3D/usr/obj/DESTDIRs/clang-powerpc64-installworld_altbinutils
package
=3D=3D=3D>   freebsd-binutils-2.29.1 depends on executable: bison - found
=3D=3D=3D>   freebsd-binutils-2.29.1 depends on executable: gmake - found
=3D=3D=3D>  Configuring for freebsd-binutils-2.29.1
configure: loading site script /usr/ports/Templates/config.site
. . .
checking for insque... yes
checking for memchr... rm -f libz.a
powerpc64-unknown-freebsd12.0-ar cru libz.a libz_a-adler32.o libz_a-compres=
s.o
libz_a-crc32.o libz_a-deflate.o libz_a-gzread.o libz_a-gzclose.o
libz_a-gzwrite.o libz_a-gzlib.o libz_a-infback.o libz_a-inffast.o
libz_a-inflate.o libz_a-inftrees.o libz_a-trees.o libz_a-uncompr.o
libz_a-zutil.o=20
gmake[4]: powerpc64-unknown-freebsd12.0-ar: Command not found
gmake[4]: *** [Makefile:401: libz.a] Error 127
gmake[4]: Leaving directory
'/wrkdirs/usr/ports/base/binutils/work/binutils-2.29.1/zlib'
gmake[3]: *** [Makefile:9026: all-zlib] Error 2
gmake[3]: *** Waiting for unfinished jobs....
yes
. . .

Using Make_JOBS_UNSAFE:

# make MAKE_JOBS_UNSAFE=3Dyes CROSS_TOOLCHAIN=3Dpowerpc64-gcc
CROSS_SYSROOT=3D/usr/obj/DESTDIRs/clang-powerpc64-installworld_altbinutils
package
. . .
/usr/local/bin/powerpc64-unknown-freebsd12.0-gcc -c -DHAVE_CONFIG_H -O2 -pi=
pe=20
--sysroot=3D/usr/obj/DESTDIRs/clang-powerpc64-installworld_altbinutils -isy=
stem
/usr/obj/DESTDIRs/clang-powerpc64-installworld_altbinutils/usr/include
--sysroot=3D/usr/obj/DESTDIRs/clang-powerpc64-installworld_altbinutils -isy=
stem
/usr/obj/DESTDIRs/clang-powerpc64-installworld_altbinutils/usr/include -g
-fstack-protector -fno-strict-aliasing
--sysroot=3D/usr/obj/DESTDIRs/clang-powerpc64-installworld_altbinutils -isy=
stem
/usr/obj/DESTDIRs/clang-powerpc64-installworld_altbinutils/usr/include
--sysroot=3D/usr/obj/DESTDIRs/clang-powerpc64-installworld_altbinutils -isy=
stem
/usr/obj/DESTDIRs/clang-powerpc64-installworld_altbinutils/usr/include -I.
-I./../include  -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes
-pedantic  -D_GNU_SOURCE ./strverscmp.c -o strverscmp.o
rm -f ./libiberty.a pic/./libiberty.a noasan/./libiberty.a
powerpc64-unknown-freebsd12.0-ar rc ./libiberty.a \
  ./regex.o ./cplus-dem.o ./cp-demangle.o ./md5.o ./sha1.o ./alloca.o ./arg=
v.o
./choose-temp.o ./concat.o ./cp-demint.o ./crc32.o ./d-demangle.o
./dwarfnames.o ./dyn-string.o ./fdmatch.o ./fibheap.o ./filename_cmp.o
./floatformat.o ./fnmatch.o ./fopen_unlocked.o ./getopt.o ./getopt1.o
./getpwd.o ./getruntime.o ./hashtab.o ./hex.o ./lbasename.o ./lrealpath.o
./make-relative-prefix.o ./make-temp-file.o ./objalloc.o ./obstack.o
./partition.o ./pexecute.o ./physmem.o ./pex-common.o ./pex-one.o ./pex-uni=
x.o
./vprintf-support.o ./rust-demangle.o ./safe-ctype.o ./simple-object.o
./simple-object-coff.o ./simple-object-elf.o ./simple-object-mach-o.o
./simple-object-xcoff.o ./sort.o ./spaces.o ./splay-tree.o ./stack-limit.o
./strerror.o ./strsignal.o ./timeval-utils.o ./unlink-if-ordinary.o
./xasprintf.o ./xatexit.o ./xexit.o ./xmalloc.o ./xmemdup.o ./xstrdup.o
./xstrerror.o ./xstrndup.o ./xvasprintf.o  ./mempcpy.o ./strverscmp.o
gmake[4]: powerpc64-unknown-freebsd12.0-ar: Command not found
gmake[4]: *** [Makefile:250: libiberty.a] Error 127
gmake[4]: Leaving directory
'/wrkdirs/usr/ports/base/binutils/work/binutils-2.29.1/libiberty'
gmake[3]: *** [Makefile:8013: all-libiberty] Error 2
gmake[3]: Leaving directory
'/wrkdirs/usr/ports/base/binutils/work/binutils-2.29.1'
gmake[2]: *** [Makefile:849: all] Error 2
gmake[2]: Leaving directory
'/wrkdirs/usr/ports/base/binutils/work/binutils-2.29.1'
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/base/binutils
*** Error code 1

Stop.
make: stopped in /usr/ports/base/binutils


# find /usr/local/bin/ -name "*powerpc64*-ar*" -print
/usr/local/bin/powerpc64-freebsd-ar
/usr/local/bin/powerpc64-unknown-freebsd12.0-gcc-ar


I've not done any work arounds to get farther into the
sequence to get other evidence for how things would go.

--=20
You are receiving this mail because:
You are on the CC list for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-224217-32340-Ee0JCYc41c>