pkgsrc-Users archive

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

Can't cross compile for sparc



Hi,
I followed this procedure here to cross compile pkgsrc : https://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/doc/HOWTO-use-crosscompile


build.sh -m sparc tools went OK :

===> Tools built to /usr/src/obj/tooldir.NetBSD-7.1.1-amd64
===> build.sh ended:      Wed Dec 27 21:07:00 UTC 2017
===> Summary of results:
         build.sh command:    ./build.sh -m sparc tools
         build.sh started:    Wed Dec 27 20:25:08 UTC 2017
         NetBSD version:      7.1_STABLE
         MACHINE:             sparc
         MACHINE_ARCH:        sparc
         Build platform:      NetBSD 7.1.1 amd64
         HOST_SH:             /bin/sh
         No $TOOLDIR/bin/nbmake, needs building.
         Bootstrapping nbmake
         MAKECONF file:       /etc/mk.conf (File not found)
         TOOLDIR path:        /usr/src/obj/tooldir.NetBSD-7.1.1-amd64
         DESTDIR path:        /usr/src/obj/destdir.sparc
         RELEASEDIR path:     /usr/src/obj/releasedir
         Created /usr/src/obj/tooldir.NetBSD-7.1.1-amd64/bin/nbmake
         Updated makewrapper: /usr/src/obj/tooldir.NetBSD-7.1.1-amd64/bin/nbmake-sparc
         Tools built to /usr/src/obj/tooldir.NetBSD-7.1.1-amd64
         build.sh ended:      Wed Dec 27 21:07:00 UTC 2017
===> .


build.sh -m sparc distribution went OK :

===> Successful make distribution
===> build.sh ended:      Thu Dec 28 04:51:59 UTC 2017
===> Summary of results:
         build.sh command:    ./build.sh -m sparc distribution
         build.sh started:    Wed Dec 27 22:28:54 UTC 2017
         NetBSD version:      7.1_STABLE
         MACHINE:             sparc
         MACHINE_ARCH:        sparc
         Build platform:      NetBSD 7.1.1 amd64
         HOST_SH:             /bin/sh
         MAKECONF file:       /etc/mk.conf (File not found)
         TOOLDIR path:        /usr/src/obj/tooldir.NetBSD-7.1.1-amd64
         DESTDIR path:        /usr/src/obj/destdir.sparc
         RELEASEDIR path:     /usr/src/obj/releasedir
         Updated makewrapper: /usr/src/obj/tooldir.NetBSD-7.1.1-amd64/bin/nbmake-sparc
         Successful make distribution
         build.sh ended:      Thu Dec 28 04:51:59 UTC 2017
===> .

Here is my mk.conf ( mostly a copy/paste from the cross compile procedure ) :

.ifdef BSD_PKG_MK       # begin pkgsrc settings
  ACCEPTABLE_LICENSES+= vim-license
  CFLAGS+=-std=gnu99
  CFLAGS+=-O2
  CXXFLAGS+=-O2
.endif                  # end pkgsrc settings

# Cross-compile by default.
#
# XXX This currently can't be set to `yes' on the command line,
# which is a bug.
 USE_CROSS_COMPILE?=  yes

# This is a kludge for cross-libtool.
#
# XXX Should not need this.
 CROSSBASE=           ${LOCALBASE}/cross-${TARGET_ARCH:U${MACHINE_ARCH}}

.if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
# Specify the machine architecture of target packages.
#
# XXX This currently can't be set on the command line, which is a
# bug.
 MACHINE_ARCH=        sparc

# Point pkgsrc at the NetBSD tooldir and destdir.
#
# XXX There is no obvious variable that is set to amd64 so that we
# could use
#
#    TOOLDIR=        /usr/obj/tooldir.${OPSYS}-${OS_VERSION}-${NATIVE_xyz}
#
# MACHINE is amd64 but, since it's not NATIVE_xyz, it's wrong.
# NATIVE_MACHINE_ARCH is x86_64, not amd64.
 TOOLDIR=             /usr/obj/tooldir.NetBSD-7.1.1-amd64/
 CROSS_DESTDIR=       /usr/obj/destdir.sparc

# Put target work and packages in separate directories.  (You might
# use OBJMACHINE=yes or WRKOBJDIR=/tmp/work.${MACHINE_ARCH} instead
# for the work directories.)
#
# XXX Should not need this.
 PACKAGES=            ${PKGSRCDIR}/packages.${MACHINE_ARCH}
 WRKDIR_BASENAME=     work.${MACHINE_ARCH}
.endif

I trid to cross compile various packages (htop, vim, python27 ) each time runing "make clean clean-depends" before runing "make pacakge". 
Each build seem to get stuck there :

checking whether the C compiler works... no
configure: error: in `/usr/pkgsrc/pkgtools/digest/work/digest-20160304':
configure: error: C compiler cannot create executables
See `config.log' for more details
*** Error code 77

Stop.
make[2]: stopped in /usr/pkgsrc/pkgtools/digest
*** Error code 1

Stop.
make[1]: stopped in /usr/pkgsrc/pkgtools/digest
*** Error code 1

Stop.
make: stopped in /usr/pkgsrc/lang/python27

Trying to cross compile digest lead to this error :

checking for working fork... cross
configure: WARNING: result yes guessed because of cross compilation
checking for working vfork... (cached) yes
checking whether snprintf is declared... yes
...
checking for DIR.dd_fd... yes
checking for dirfd... yes
checking *printf() support for %lld... checking *printf() support for %qd... checking if vsnprintf is standards compliant... configure: creating ./config.status
config.status: creating Makefile
config.status: creating nbcompat/config.h
/usr/bin/awk -f nbcompat.awk nbcompat/config.h > nbcompat/nbconfig.h
sparc--netbsdelf-gcc -DHAVE_NBCOMPAT_H=1 -I/usr/pkgsrc/pkgtools/cwrappers/work.sparc/libnbcompat -I. -I.  -O2 -std=gnu99 -O2 -D_FORTIFY_SOURCE=2 -DHAVE_CONFIG_H -c glob.c
sparc--netbsdelf-gcc -DHAVE_NBCOMPAT_H=1 -I/usr/pkgsrc/pkgtools/cwrappers/work.sparc/libnbcompat -I. -I.  -O2 -std=gnu99 -O2 -D_FORTIFY_SOURCE=2 -DHAVE_CONFIG_H -c snprintf.c
In file included from /usr/obj/destdir.sparc/usr/include/stdio.h:593:0,
                 from /usr/pkgsrc/pkgtools/cwrappers/work.sparc/libnbcompat/nbcompat/stdio.h:40,
                 from /usr/pkgsrc/pkgtools/cwrappers/work.sparc/libnbcompat/nbcompat.h:61,
                 from snprintf.c:28:
snprintf.c:43:1: error: expected declaration specifiers or '...' before numeric constant
 snprintf(char *str, size_t size, const char *format, ...)
 ^
In file included from /usr/obj/destdir.sparc/usr/include/ssp/stdio.h:34:0,
                 from /usr/obj/destdir.sparc/usr/include/stdio.h:593,
                 from /usr/pkgsrc/pkgtools/cwrappers/work.sparc/libnbcompat/nbcompat/stdio.h:40,
                 from /usr/pkgsrc/pkgtools/cwrappers/work.sparc/libnbcompat/nbcompat.h:61,
                 from snprintf.c:28:
snprintf.c:43:1: error: expected declaration specifiers or '...' before '__builtin_object_size'
 snprintf(char *str, size_t size, const char *format, ...)
 ^
In file included from /usr/obj/destdir.sparc/usr/include/stdio.h:593:0,
                 from /usr/pkgsrc/pkgtools/cwrappers/work.sparc/libnbcompat/nbcompat/stdio.h:40,
                 from /usr/pkgsrc/pkgtools/cwrappers/work.sparc/libnbcompat/nbcompat.h:61,
                 from snprintf.c:28:
snprintf.c:55:1: error: expected declaration specifiers or '...' before numeric constant
 vsnprintf(char *str, size_t size, const char *format, va_list ap)
 ^
In file included from /usr/obj/destdir.sparc/usr/include/ssp/stdio.h:34:0,
                 from /usr/obj/destdir.sparc/usr/include/stdio.h:593,
                 from /usr/pkgsrc/pkgtools/cwrappers/work.sparc/libnbcompat/nbcompat/stdio.h:40,
                 from /usr/pkgsrc/pkgtools/cwrappers/work.sparc/libnbcompat/nbcompat.h:61,
                 from snprintf.c:28:
snprintf.c:55:1: error: expected declaration specifiers or '...' before '__builtin_object_size'
 vsnprintf(char *str, size_t size, const char *format, va_list ap)
 ^
*** [snprintf.o] Error code 1

make: stopped in /usr/pkgsrc/pkgtools/cwrappers/work.sparc/libnbcompat
1 error

make: stopped in /usr/pkgsrc/pkgtools/cwrappers/work.sparc/libnbcompat
*** Error code 2

Stop.
make[2]: stopped in /usr/pkgsrc/pkgtools/cwrappers
*** Error code 1

Stop.
make[1]: stopped in /usr/pkgsrc/pkgtools/cwrappers
*** Error code 1

Stop.
make: stopped in /usr/pkgsrc/pkgtools/digest

Am I missing something ? Is my mk.conf correct ? Any suggestions ?


Home | Main Index | Thread Index | Old Index