Skip to content

arm32v7 #37

Closed
Closed
@tianon

Description

@tianon

Cross-posting from #36 (comment):

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77447

I suspect you did not use --with-float=hard

https://sources.debian.net/src/gcc-6/6.3.0-18/debian/rules2/#L491-L536 is another good link where Debian adds a bunch of extra compile flags to ARM builds, like specifying exactly which ARM we're compiling for, and the features of it, which should fix our current build failure there:

/tmp/tmp.zQHpdm2qVk/./gcc/xgcc -B/tmp/tmp.zQHpdm2qVk/./gcc/ -B/usr/local/arm-linux-gnueabihf/bin/ -B/usr/local/arm-linux-gnueabihf/lib/ -isystem /usr/local/arm-linux-gnueabihf/include -isystem /usr/local/arm-linux-gnueabihf/sys-include    -g -O2 -O2  -g -O2 -DIN_GCC    -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fPIC -fno-inline -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector   -fPIC -fno-inline -I. -I. -I../.././gcc -I/usr/src/gcc/libgcc -I/usr/src/gcc/libgcc/. -I/usr/src/gcc/libgcc/../gcc -I/usr/src/gcc/libgcc/../include  -DHAVE_CC_TLS  -o _clear_cache_s.o -MT _clear_cache_s.o -MD -MP -MF _clear_cache_s.dep -DSHARED -DL_clear_cache -xassembler-with-cpp -c /usr/src/gcc/libgcc/config/arm/lib1funcs.S
/tmp/tmp.zQHpdm2qVk/./gcc/nm -pg _clear_cache_s.o | mawk 'NF == 3 && $2 !~ /^[UN]$/ && $3 !~ /.*_compat/ && $3 !~ /.*@.*/ { print "\t.hidden", $3 }' > _clear_cache.visT
mv -f _clear_cache.visT _clear_cache.vis
/tmp/tmp.zQHpdm2qVk/./gcc/xgcc -B/tmp/tmp.zQHpdm2qVk/./gcc/ -B/usr/local/arm-linux-gnueabihf/bin/ -B/usr/local/arm-linux-gnueabihf/lib/ -isystem /usr/local/arm-linux-gnueabihf/include -isystem /usr/local/arm-linux-gnueabihf/sys-include    -g -O2 -O2  -g -O2 -DIN_GCC    -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fPIC -fno-inline -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector   -fPIC -fno-inline -I. -I. -I../.././gcc -I/usr/src/gcc/libgcc -I/usr/src/gcc/libgcc/. -I/usr/src/gcc/libgcc/../gcc -I/usr/src/gcc/libgcc/../include  -DHAVE_CC_TLS  -o _clear_cache.o -MT _clear_cache.o -MD -MP -MF _clear_cache.dep -DL_clear_cache -xassembler-with-cpp -c /usr/src/gcc/libgcc/config/arm/lib1funcs.S -include _clear_cache.vis
/tmp/tmp.zQHpdm2qVk/./gcc/xgcc -B/tmp/tmp.zQHpdm2qVk/./gcc/ -B/usr/local/arm-linux-gnueabihf/bin/ -B/usr/local/arm-linux-gnueabihf/lib/ -isystem /usr/local/arm-linux-gnueabihf/include -isystem /usr/local/arm-linux-gnueabihf/sys-include    -g -O2 -O2  -g -O2 -DIN_GCC    -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fPIC -fno-inline -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector   -fPIC -fno-inline -I. -I. -I../.././gcc -I/usr/src/gcc/libgcc -I/usr/src/gcc/libgcc/. -I/usr/src/gcc/libgcc/../gcc -I/usr/src/gcc/libgcc/../include  -DHAVE_CC_TLS  -o _muldi3.o -MT _muldi3.o -MD -MP -MF _muldi3.dep -DL_muldi3 -c /usr/src/gcc/libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS
In file included from /usr/include/stdio.h:27:0,
                 from /usr/src/gcc/libgcc/../gcc/tsystem.h:87,
                 from /usr/src/gcc/libgcc/libgcc2.c:27:
/usr/include/features.h:364:12: fatal error: sys/cdefs.h: No such file or directory
 #  include <sys/cdefs.h>
            ^~~~~~~~~~~~~
compilation terminated.
make[3]: *** [_muldi3.o] Error 1
Makefile:491: recipe for target '_muldi3.o' failed
make[3]: Leaving directory '/tmp/tmp.zQHpdm2qVk/arm-linux-gnueabihf/libgcc'
make[2]: *** [all-stage1-target-libgcc] Error 2
Makefile:21935: recipe for target 'all-stage1-target-libgcc' failed
make[2]: Leaving directory '/tmp/tmp.zQHpdm2qVk'
make[1]: *** [stage1-bubble] Error 2
Makefile:27403: recipe for target 'stage1-bubble' failed
make[1]: Leaving directory '/tmp/tmp.zQHpdm2qVk'
make: *** [all] Error 2
Makefile:940: recipe for target 'all' failed
The command '/bin/sh -c set -ex 	&& buildDeps=' 		dpkg-dev 		flex 	' 	&& apt-get update 	&& apt-get install -y --no-install-recommends $buildDeps 	&& rm -r /var/lib/apt/lists/* 	&& curl -fSL "http://ftpmirror.gnu.org/gcc/gcc-$GCC_VERSION/gcc-$GCC_VERSION.tar.bz2" -o gcc.tar.bz2 	&& curl -fSL "http://ftpmirror.gnu.org/gcc/gcc-$GCC_VERSION/gcc-$GCC_VERSION.tar.bz2.sig" -o gcc.tar.bz2.sig 	&& gpg --batch --verify gcc.tar.bz2.sig gcc.tar.bz2 	&& mkdir -p /usr/src/gcc 	&& tar -xf gcc.tar.bz2 -C /usr/src/gcc --strip-components=1 	&& rm gcc.tar.bz2* 	&& cd /usr/src/gcc 	&& ./contrib/download_prerequisites 	&& { rm *.tar.* || true; } 	&& for f in config.guess config.sub; do 		wget -O "$f" "https://git.savannah.gnu.org/cgit/config.git/plain/$f?id=7d3d27baf8107b630586c962c057e22149653deb"; 		find -mindepth 2 -name "$f" -exec cp -v "$f" '{}' ';'; 	done 	&& dir="$(mktemp -d)" 	&& cd "$dir" 	&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" 	&& /usr/src/gcc/configure 		--build="$gnuArch" 		--disable-multilib 		--enable-languages=c,c++,fortran,go 	&& make -j"$(nproc)" 	&& make install-strip 	&& cd .. 	&& rm -rf "$dir" 	&& apt-get purge -y --auto-remove $buildDeps' returned a non-zero code: 2

Embedding that Debian code in case the link changes (it's the version from stretch so may or may not change before release):

ifneq (,$(findstring arm, $(DEB_TARGET_GNU_CPU)))
  ifeq ($(multilib),yes)
    CONFARGS += --enable-multilib
  endif
  CONFARGS += --disable-sjlj-exceptions
  # FIXME: libjava is not ported for thumb, this hack only works for
  # separate gcj builds
  ifneq (,$(filter %armhf,$(DEB_TARGET_ARCH)))
    ifeq ($(distribution),Raspbian)
      with_arm_arch = armv6
      with_arm_fpu = vfp
    else
      ifneq (,$(findstring gcj,$(PKGSOURCE)))
        with_arm_arch = armv6
      else
        with_arm_arch = armv7-a
      endif
      with_arm_fpu = vfpv3-d16
    endif
  else
    # armel
    ifeq ($(derivative),Debian)
      with_arm_arch = armv4t
    else ifneq (,$(filter $(distrelease),karmic))
      with_arm_arch = armv6
      with_arm_fpu = vfpv3-d16
    else ifneq (,$(filter $(distrelease),lucid maverick natty oneiric precise))
      ifneq (,$(findstring gcj,$(PKGSOURCE)))
        with_arm_arch = armv6
      else
        with_arm_arch = armv7-a
      endif
      with_arm_fpu = vfpv3-d16
    else
      with_arm_arch = armv5t  # starting with quantal
    endif
  endif
  CONFARGS += --with-arch=$(with_arm_arch)
  ifneq (,$(with_arm_fpu))
    CONFARGS += --with-fpu=$(with_arm_fpu)
  endif
  CONFARGS += --with-float=$(float_abi)
  ifeq ($(with_arm_thumb),yes)
    CONFARGS += --with-mode=thumb
  endif
endif

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions