Modify

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#12541 closed defect (wontfix)

package/devel/gcc (gcc-linaro-4.7-2012.10) won't compile for target x86_64

Reported by: rossb@… Owned by: developers
Priority: normal Milestone: Chaos Calmer 15.05
Component: packages Version: Trunk
Keywords: Cc:

Description

...but will for target-i386

Notes:
Makefile is modified from toolchain, to use .config values

Have not been able to get following config options working:
# --with-gmp=$(TOPDIR)/staging_dir/host \
# --with-mpfr=$(TOPDIR)/staging_dir/host \
# --with-mpc=$(TOPDIR)/staging_dir/host \
...so, these files are DL'd during prepare.

PKG_VERSION:=1 is overwritten, but without it, make complains "no version"
Makefile:

# 
# Copyright (C) 2008 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk

PKG_NAME:=gcc
GCC_VERSION:=$(call qstrip,$(CONFIG_GCC_VERSION))
PKG_VERSION:=1
#PKG_VERSION:=$(firstword $(subst +, ,$(GCC_VERSION)))
TRASH_VERSION:=$(firstword $(subst +, ,$(GCC_VERSION)))

GCC_DIR:=$(PKG_NAME)-$(PKG_VERSION)

ifdef CONFIG_GCC_VERSION_LLVM
  PKG_SOURCE_VERSION:=c98c494b72ff875884c0c7286be67f16f9f6d7ab
  PKG_REV:=83504
  GCC_DIR:=llvm-gcc-4.2-r$(PKG_REV)
  PKG_VERSION:=4.2.1
  PKG_SOURCE:=$(GCC_DIR).tar.gz
  PKG_SOURCE_PROTO:=git
  PKG_SOURCE_URL:=git://repo.or.cz/llvm-gcc-4.2.git
  PKG_SOURCE_SUBDIR:=$(GCC_DIR)
  PKG_BUILD_DIR:=$(BUILD_DIR)/$(GCC_DIR)
else
ifeq ($(findstring linaro, $(CONFIG_GCC_VERSION)),linaro)
    ifeq ($(CONFIG_GCC_VERSION),"4.5-linaro")
      PKG_REV:=4.5-2012.03
      PKG_VERSION:=4.5.4
      PKG_VERSION_MAJOR:=4.5
      PKG_MD5SUM:=0c25f93e15e362e352c933e4649a7fc6
    endif
    ifeq ($(CONFIG_GCC_VERSION),"4.6-linaro")
      PKG_REV:=4.6-2012.10
      PKG_VERSION:=4.6.4
      PKG_VERSION_MAJOR:=4.6
      PKG_MD5SUM:=acd304caf055ccaaca4e3ef61da11e7d
    endif
    ifeq ($(CONFIG_GCC_VERSION),"4.7-linaro")
      PKG_REV:=4.7-2012.10
      #PKG_VERSION:=4.7.3
      PKG_VERSION:=$(GCC_VERSION)
      PKG_VERSION_MAJOR:=4.7
      PKG_MD5SUM:=a5ca87667350f1395d4da40c94ef059c
    endif
    PKG_SOURCE_URL:=http://launchpad.net/gcc-linaro/$(PKG_VERSION_MAJOR)/$(PKG_REV)/+download/
    PKG_SOURCE:=$(PKG_NAME)-linaro-$(PKG_REV).tar.bz2
    GCC_DIR:=gcc-linaro-$(PKG_REV)
    PKG_BUILD_DIR:=$(BUILD_DIR)/$(GCC_DIR)
else
  PKG_SOURCE_URL:=@GNU/gcc/gcc-$(PKG_VERSION)
  PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2

  ifeq ($(PKG_VERSION),4.4.7)
    PKG_MD5SUM:=295709feb4441b04e87dea3f1bab4281
  endif
  ifeq ($(PKG_VERSION),4.6.2)
    PKG_MD5SUM:=028115c4fbfb6cfd75d6369f4a90d87e
  endif
  ifeq ($(PKG_VERSION),4.6.3)
    PKG_MD5SUM:=773092fe5194353b02bb0110052a972e
  endif
  ifeq ($(PKG_VERSION),4.7.0)
    PKG_MD5SUM:=2a0f1d99fda235c29d40b561f81d9a77
  endif
  ifeq ($(PKG_VERSION),4.7.2)
    PKG_MD5SUM:=cc308a0891e778cfda7a151ab8a6e762
  endif
endif
endif

PATCH_DIR=$(TOPDIR)/toolchain/gcc/patches/$(PKG_VERSION)

include $(INCLUDE_DIR)/package.mk

AUTOCONF_2_64_PATH=$(STAGING_DIR_HOST)/autoconf-2.64/bin
PACKAGE_DL_SOURCE=http://192.168.1.9:8080/OpenWrt/Package_Source

SEP:=,
TARGET_LANGUAGES:="c$(if $(CONFIG_INSTALL_LIBSTDCPP),$(SEP)c++)$(if $(CONFIG_INSTALL_LIBGCJ),$(SEP)java)$(if $(CONFIG_INSTALL_GFORTRAN),$(SEP)fortran)"

export libgcc_cv_fixed_point=no
ifdef CONFIG_USE_UCLIBC
  export glibcxx_cv_c99_math_tr1=no
endif

GCC_CONFIGURE:= \
        SHELL="$(BASH)" \
        $(TARGET_CONFIGURE_OPTS) \
        $(PKG_BUILD_DIR)/configure \
                $(TARGET_CONFIGURE_ARGS) \
                --build=$(GNU_HOST_NAME) \
                --host=$(REAL_GNU_TARGET_NAME) \
                --target=$(REAL_GNU_TARGET_NAME) \
                --enable-languages=$(TARGET_LANGUAGES) \
                --enable-shared \
                --with-gnu-ld \
                --enable-target-optspace \
                --disable-libgomp \
                --disable-libmudflap \
                --disable-multilib \
                --disable-nls \
                $(GRAPHITE_CONFIGURE) \
                $(SOFT_FLOAT_CONFIG_OPTION) \
                $(call qstrip,$(CONFIG_EXTRA_GCC_CONFIG_OPTIONS)) \
                $(if $(CONFIG_mips64)$(CONFIG_mips64el),--with-arch=mips64 --with-abi=64) \
                $(if $(CONFIG_GCC_VERSION_LLVM),--enable-llvm=$(BUILD_DIR_BASE)/host/llvm) \
                $(if $(CONFIG_sparc),--with-long-double-128) \

#               --disable-libgomp \
#               --with-host-libstdcxx=-lstdc++ \
#               --with-gmp=$(TOPDIR)/staging_dir/host \
#               --with-mpfr=$(TOPDIR)/staging_dir/host \
#               --with-mpc=$(TOPDIR)/staging_dir/host \

ifeq ($(CONFIG_GCC_LLVM),)
  GCC_BUILD_TARGET_LIBGCC:=y
  GCC_CONFIGURE+= \
                --disable-decimal-float
  ifneq ($(CONFIG_mips)$(CONFIG_mipsel),)
    GCC_CONFIGURE += --with-mips-plt
  endif
endif
#                --with-gmp=$(TOPDIR)/staging_dir/host \
#                --with-mpfr=$(TOPDIR)/staging_dir/host \

#ifneq ($(CONFIG_GCC_VERSION_4_5)$(CONFIG_GCC_VERSION_4_6),)
#  GCC_CONFIGURE+= \
#                --with-mpc=$(TOPDIR)/staging_dir/host
#endif

ifneq ($(CONFIG_SSP_SUPPORT),)
  GCC_CONFIGURE+= \
                --enable-libssp
else
  GCC_CONFIGURE+= \
                --disable-libssp
endif

ifneq ($(CONFIG_EXTRA_TARGET_ARCH),)
  GCC_CONFIGURE+= \
                --enable-biarch \
                --enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-$(TARGET_SUFFIX)
endif

ifdef CONFIG_sparc
  GCC_CONFIGURE+= --enable-targets=all
endif

#ifeq ($(LIBC),uClibc)
  GCC_CONFIGURE+= \
                --disable-__cxa_atexit
#else
#  GCC_CONFIGURE+= \
#                --enable-__cxa_atexit
#endif

ifneq ($(GCC_ARCH),)
  GCC_CONFIGURE+= --with-arch=$(GCC_ARCH)
endif

define Package/gcc
  SECTION:=devel
  CATEGORY:=Development
  TITLE:=gcc
  DEPENDS:=@TARGET_x86 @NO_STRIP
endef

define Package/gcc/description
        build a native toolchain for compiling on target
endef

define Build/Prepare
        $(call Build/Prepare/Default)
        $(SED) 's,\(version_string.. = "[0-9\.]*\).*\(";\),\1 (OpenWrt-2.0)\2,' $(PKG_BUILD_DIR)/gcc/version.c
        $(SED) 's,\(bug_report_url.. = "\).*\(";\),\1<URL:https://dev.openwrt.org/>\2,' $(PKG_BUILD_DIR)/gcc/version.c
        (cd $(PKG_BUILD_DIR)/libstdc++-v3; $(AUTOCONF_2_64_PATH)/autoconf;);
        $(SED) 's,gcc_no_link=yes,gcc_no_link=no,' $(PKG_BUILD_DIR)/libstdc++-v3/configure
        echo PKG_VERSION: $(PKG_VERSION)
        echo PATCH_DIR: $(PATCH_DIR)
        echo GCC_VERSION: $(GCC_VERSION)
        echo TRASH_VERSION: $(TRASH_VERSION)
        echo PKG_BUILD_DIR: $(PKG_BUILD_DIR)
        wget -P $(PKG_BUILD_DIR) $(PACKAGE_DL_SOURCE)/gmp-4.3.2.tar.bz2
        cd $(PKG_BUILD_DIR); tar -xvf gmp-4.3.2.tar.bz2; mv gmp-4.3.2 gmp; cd -;
        wget -P $(PKG_BUILD_DIR) $(PACKAGE_DL_SOURCE)/mpfr-2.4.2.tar.bz2
        cd $(PKG_BUILD_DIR); tar -xvf mpfr-2.4.2.tar.bz2; mv mpfr-2.4.2 mpfr; cd -;
        wget -P $(PKG_BUILD_DIR) $(PACKAGE_DL_SOURCE)/mpc-0.8.1.tar.gz
        cd $(PKG_BUILD_DIR); tar -xvf mpc-0.8.1.tar.gz; mv mpc-0.8.1 mpc; cd -;
endef

define Build/Configure
        (cd $(PKG_BUILD_DIR) && rm -f config.cache; \
                $(GCC_CONFIGURE) \
        );
endef

define Build/Compile
        export SHELL="$(BASH)"; $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) \
                        DESTDIR="$(PKG_INSTALL_DIR)" $(MAKE_ARGS) all install
        # Set up the symlinks to enable lying about target name.
        set -e; \
        (cd $(TOOLCHAIN_DIR); \
                ln -sf $(REAL_GNU_TARGET_NAME) $(GNU_TARGET_NAME); \
                cd bin; \
                for app in $(REAL_GNU_TARGET_NAME)-* ; do \
                        ln -sf $$$${app} \
                        $(GNU_TARGET_NAME)$$$${app##$(REAL_GNU_TARGET_NAME)}; \
                done; \
        );
endef

define Package/gcc/install
        $(INSTALL_DIR) $(1)/usr/lib/
        cp -r $(PKG_INSTALL_DIR)/* $(1)
        cp -r $(TOOLCHAIN_DIR)/include $(1)/usr/
        cp $(TOOLCHAIN_DIR)/lib/crt* $(1)/usr/lib/
        cp $(TOOLCHAIN_DIR)/lib/libc.so $(1)/usr/lib/
endef

$(eval $(call BuildPackage,gcc))

Result:

x86_64-openwrt-linux-gnu-gcc -c    -DIN_GCC   -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wc++-compat   -DHAVE_CONFIG_H -I. -I. -I../.././gcc -I../.././gcc/. -I../.././gcc/../include -I../.././gcc/../libcpp/include -I/home/rossb/OpenWrt/x86_64/r34389/trunk/build_dir/target-x86_64_eglibc-2.16/gcc-linaro-4.7-2012.10/host-x86_64-openwrt-linux-gnu/gmp -I/home/rossb/OpenWrt/x86_64/r34389/trunk/build_dir/target-x86_64_eglibc-2.16/gcc-linaro-4.7-2012.10/gmp -I/home/rossb/OpenWrt/x86_64/r34389/trunk/build_dir/target-x86_64_eglibc-2.16/gcc-linaro-4.7-2012.10/host-x86_64-openwrt-linux-gnu/mpfr -I/home/rossb/OpenWrt/x86_64/r34389/trunk/build_dir/target-x86_64_eglibc-2.16/gcc-linaro-4.7-2012.10/mpfr -I/home/rossb/OpenWrt/x86_64/r34389/trunk/build_dir/target-x86_64_eglibc-2.16/gcc-linaro-4.7-2012.10/mpc/src  -I../.././gcc/../libdecnumber -I../.././gcc/../libdecnumber/dpd -I../libdecnumber    \
		../.././gcc/config/i386/i386.c -o i386.o
cc1: note: someone does not honour COPTS correctly, passed 0 times
../.././gcc/config/i386/i386.c: In function 'ix86_expand_multi_arg_builtin':
../.././gcc/config/i386/i386.c:27917:3: error: duplicate case value
../.././gcc/config/i386/i386.c:27916:3: error: previously used here
../.././gcc/config/i386/i386.c:27918:3: error: duplicate case value
../.././gcc/config/i386/i386.c:27916:3: error: previously used here
../.././gcc/config/i386/i386.c:27919:3: error: duplicate case value
../.././gcc/config/i386/i386.c:27916:3: error: previously used here
../.././gcc/config/i386/i386.c:27922:3: error: duplicate case value
../.././gcc/config/i386/i386.c:27916:3: error: previously used here
../.././gcc/config/i386/i386.c:27925:3: error: duplicate case value
../.././gcc/config/i386/i386.c:27916:3: error: previously used here
../.././gcc/config/i386/i386.c:27928:3: error: duplicate case value
../.././gcc/config/i386/i386.c:27916:3: error: previously used here
../.././gcc/config/i386/i386.c:27931:3: error: duplicate case value
../.././gcc/config/i386/i386.c:27916:3: error: previously used here
../.././gcc/config/i386/i386.c: In function 'ix86_expand_args_builtin':
../.././gcc/config/i386/i386.c:28854:8: error: duplicate case value
../.././gcc/config/i386/i386.c:28853:8: error: previously used here
../.././gcc/config/i386/i386.c:28855:8: error: duplicate case value
../.././gcc/config/i386/i386.c:28853:8: error: previously used here
../.././gcc/config/i386/i386.c:28856:8: error: duplicate case value
../.././gcc/config/i386/i386.c:28853:8: error: previously used here
make[5]: *** [i386.o] Error 1

Suggestions?

Attachments (0)

Change History (3)

comment:1 Changed 5 years ago by jow

  • Resolution set to wontfix
  • Status changed from new to closed

OpenWrt does not provide an x86_64 target. Direct general development questions to the mailing lists.

comment:2 Changed 5 years ago by florian

We actually do provide one when building UML on x86_64, but I cannot reproduce that build error here.

comment:3 Changed 5 years ago by rossb@…

"We actually do provide one when building UML on x86_64, but I cannot reproduce that build error here."

Would really appreciate a peek at your devel/gcc/Makefile

one clue I am pursuing is that after fail (in following directory):

Leaving directory `/home/rossb/OpenWrt/x86_64/r34389/trunk/build_dir/target-x86_64_eglibc-2.16/gcc-linaro-4.7-2012.10/host-x86_64-openwrt-linux-gnu/gcc'

an indication it is compiling in gcc-xxx/host-x86_64-openwrt-linux-gnu/gcc. There is no equivalent host-ix86 directory for 32 bit builds.

my actual build system is Centos-6 VM, but this failure also happens using an OpenWrt/x86_64/r29299 system on real hardware for builds (of trunk r34185, r34389).

Not sure what mailing list I should direct this to, since need OpenWrt to replicate and, 'net searches come up empty.

The last successful 86_64/devel/gcc build was of trunk/r29299. Fail on r34185, r34389.

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.