【未解决】cygwin下编译crosstool-ng期间在配置eglibc时出现警告:checking add-on ports for preconfigure fragments… aarch64 alpha am33 arm arm/preconfigure: Did not find ARM architecture type; using default

【问题】

折腾:

【或许解决】cygwin中编译crosstool-ng在Installing C library headers & start files阶段出错:configure: error: support for the tls_model attribute is required

期间,在Installing C library headers & start files期间,去配置eglibc,结果算是基本解决了:

configure: error: support for the tls_model attribute is required

的问题,但是看到有警告:

[INFO ]  =================================================================
[INFO ]  Installing C library headers & start files
[EXTRA]    Configuring C library
[DEBUG]    Using gcc for target    : '/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/buildtools/bin/arm-arm920t-linux-gnueabi-gcc'
[DEBUG]    Configuring with addons : 'nptl,ports'
[DEBUG]    Extra config args passed: '--enable-obsolete-rpc --enable-kernel=2.6.30 --with-__thread --with-tls --enable-shared --without-fp --enable-add-ons=nptl,ports --with-pkgversion=crosstool-NG 1.18.0'
[DEBUG]    Extra CC args passed    : ' -U_FORTIFY_SOURCE  -mlittle-endian -march=armv4t   -mtune=arm920t  -msoft-float -O -O2 '
[DEBUG]    Extra flags (multilib)  : ''
[DEBUG]    ==> Executing: 'BUILD_CC=i686-build_pc-cygwin-gcc' 'CFLAGS= -U_FORTIFY_SOURCE  -mlittle-endian -march=armv4t   -mtune=arm920t  -msoft-float -O -O2 ' 'CC=arm-arm920t-linux-gnueabi-gcc    ' 'AR=arm-arm920t-linux-gnueabi-ar' 'RANLIB=arm-arm920t-linux-gnueabi-ranlib' '/usr/bin/bash' '/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/eglibc-2_17/configure' '--prefix=/usr' '--build=i686-build_pc-cygwin' '--host=arm-arm920t-linux-gnueabi' '--cache-file=/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-startfiles/config.cache' '--without-cvs' '--disable-profile' '--without-gd' '--with-headers=/home/develop/crosstool-ng/x-tools/arm-arm920t-linux-gnueabi/arm-arm920t-linux-gnueabi/sysroot/usr/include' '--enable-obsolete-rpc' '--enable-kernel=2.6.30' '--with-__thread' '--with-tls' '--enable-shared' '--without-fp' '--enable-add-ons=nptl,ports' '--with-pkgversion=crosstool-NG 1.18.0' 
[CFG  ]    configure: loading cache /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-startfiles/config.cache
[CFG  ]    checking build system type... i686-build_pc-cygwin
[CFG  ]    checking host system type... arm-arm920t-linux-gnueabi
[CFG  ]    checking for arm-arm920t-linux-gnueabi-gcc... arm-arm920t-linux-gnueabi-gcc    
[CFG  ]    checking for suffix of object files... o
[CFG  ]    checking whether we are using the GNU C compiler... yes
[CFG  ]    checking whether arm-arm920t-linux-gnueabi-gcc     accepts -g... yes
[CFG  ]    checking for arm-arm920t-linux-gnueabi-gcc     option to accept ISO C89... unsupported
[CFG  ]    checking for gcc... i686-build_pc-cygwin-gcc
[CFG  ]    checking how to run the C preprocessor... arm-arm920t-linux-gnueabi-gcc     -E
[CFG  ]    checking for arm-arm920t-linux-gnueabi-g++... no
[CFG  ]    checking for arm-arm920t-linux-gnueabi-c++... no
[CFG  ]    checking for arm-arm920t-linux-gnueabi-gpp... no
[CFG  ]    checking for arm-arm920t-linux-gnueabi-aCC... no
[CFG  ]    checking for arm-arm920t-linux-gnueabi-CC... no
[CFG  ]    checking for arm-arm920t-linux-gnueabi-cxx... no
[CFG  ]    checking for arm-arm920t-linux-gnueabi-cc++... no
[CFG  ]    checking for arm-arm920t-linux-gnueabi-cl.exe... no
[CFG  ]    checking for arm-arm920t-linux-gnueabi-FCC... no
[CFG  ]    checking for arm-arm920t-linux-gnueabi-KCC... no
[CFG  ]    checking for arm-arm920t-linux-gnueabi-RCC... no
[CFG  ]    checking for arm-arm920t-linux-gnueabi-xlC_r... no
[CFG  ]    checking for arm-arm920t-linux-gnueabi-xlC... no
[CFG  ]    checking for g++... g++
[CFG  ]    configure: WARNING: using cross tools not prefixed with host triplet
[CFG  ]    checking whether we are using the GNU C++ compiler... yes
[CFG  ]    checking whether g++ accepts -g... yes
[CFG  ]    checking for arm-arm920t-linux-gnueabi-readelf... arm-arm920t-linux-gnueabi-readelf
[CFG  ]    checking for sysdeps preconfigure fragments... x86_64 
[CFG  ]    configure: running configure fragment for add-on nptl
[CFG  ]    checking add-on ports for preconfigure fragments... aarch64 alpha am33 arm arm/preconfigure: Did not find ARM architecture type; using default
[CFG  ]    hppa ia64 m68k mips powerpc tile 
[CFG  ]    checking for assembler and linker STT_GNU_IFUNC support... no
[CFG  ]    checking whether .text pseudo-op must be used... yes
[CFG  ]    checking sysdep dirs... ports/sysdeps/unix/sysv/linux/arm/nptl ports/sysdeps/unix/sysv/linux/arm nptl/sysdeps/unix/sysv/linux nptl/sysdeps/pthread sysdeps/pthread ports/sysdeps/unix/sysv/linux sysdeps/unix/sysv/linux sysdeps/gnu sysdeps/unix/inet nptl/sysdeps/unix/sysv ports/sysdeps/unix/sysv sysdeps/unix/sysv ports/sysdeps/unix/arm nptl/sysdeps/unix ports/sysdeps/unix sysdeps/unix sysdeps/posix ports/sysdeps/arm/nptl ports/sysdeps/arm sysdeps/wordsize-32 sysdeps/ieee754/flt-32 sysdeps/ieee754/dbl-64 sysdeps/ieee754 sysdeps/generic
[CFG  ]    checking for a BSD-compatible install... /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/tools/bin/install -c
[CFG  ]    checking whether ln -s works... yes
[CFG  ]    checking whether /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/buildtools/lib/gcc/arm-arm920t-linux-gnueabi/4.3.2/../../../../arm-arm920t-linux-gnueabi/bin/as is GNU as... yes
[CFG  ]    checking whether /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/buildtools/lib/gcc/arm-arm920t-linux-gnueabi/4.3.2/../../../../arm-arm920t-linux-gnueabi/bin/ld is GNU ld... yes
[CFG  ]    checking for /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/buildtools/lib/gcc/arm-arm920t-linux-gnueabi/4.3.2/../../../../arm-arm920t-linux-gnueabi/bin/as... /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/buildtools/lib/gcc/arm-arm920t-linux-gnueabi/4.3.2/../../../../arm-arm920t-linux-gnueabi/bin/as
[CFG  ]    checking version of /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/buildtools/lib/gcc/arm-arm920t-linux-gnueabi/4.3.2/../../../../arm-arm920t-linux-gnueabi/bin/as... 2.20.1.20100303, ok
[CFG  ]    checking for /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/buildtools/lib/gcc/arm-arm920t-linux-gnueabi/4.3.2/../../../../arm-arm920t-linux-gnueabi/bin/ld... /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/buildtools/lib/gcc/arm-arm920t-linux-gnueabi/4.3.2/../../../../arm-arm920t-linux-gnueabi/bin/ld
[CFG  ]    checking version of /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/buildtools/lib/gcc/arm-arm920t-linux-gnueabi/4.3.2/../../../../arm-arm920t-linux-gnueabi/bin/ld... 2.20.1.20100303, ok
[CFG  ]    checking for arm-arm920t-linux-gnueabi-gcc... (cached) arm-arm920t-linux-gnueabi-gcc    
[CFG  ]    checking version of arm-arm920t-linux-gnueabi-gcc    ... 4.3.2, ok
[CFG  ]    checking for gnumake... no
[CFG  ]    checking for gmake... no
[CFG  ]    checking for make... make
[CFG  ]    checking version of make... 3.81, ok
[CFG  ]    checking for gnumsgfmt... no
[CFG  ]    checking for gmsgfmt... no
[CFG  ]    checking for msgfmt... msgfmt
[CFG  ]    checking version of msgfmt... 0.18.1, ok
[CFG  ]    checking for makeinfo... makeinfo
[CFG  ]    checking version of makeinfo... 4.13, ok
[CFG  ]    checking for sed... sed
[CFG  ]    checking version of sed... 4.2.1, ok
[CFG  ]    checking for gawk... gawk
[CFG  ]    checking version of gawk... 4.0.1, ok
[CFG  ]    checking for arm-arm920t-linux-gnueabi-nm... arm-arm920t-linux-gnueabi-nm
[CFG  ]    checking for autoconf... autoconf
[CFG  ]    checking whether autoconf works... yes
[CFG  ]    checking LD_LIBRARY_PATH variable... ok
[CFG  ]    checking whether GCC supports -static-libgcc... -static-libgcc
[CFG  ]    checking for bash... (cached) /bin/bash
[CFG  ]    checking for perl... /usr/bin/perl
[CFG  ]    checking for install-info... /usr/bin/install-info
[CFG  ]    checking for bison... /usr/bin/bison
[CFG  ]    checking for libc-friendly stddef.h... yes
[CFG  ]    checking whether we need to use -P to assemble .S files... no
[CFG  ]    checking for .set assembler directive... yes
[CFG  ]    checking for assembler gnu_unique_object symbol type... yes
[CFG  ]    checking for .symver assembler directive... yes
[CFG  ]    checking for ld --version-script... yes
[CFG  ]    checking for .previous assembler directive... yes
[CFG  ]    checking for .protected and .hidden assembler directive... yes
[CFG  ]    checking whether __attribute__((visibility())) is supported... yes
[CFG  ]    checking for broken __attribute__((visibility()))... no
[CFG  ]    checking for broken __attribute__((alias()))... no
[CFG  ]    checking whether to put _rtld_local into .sdata section... no
[CFG  ]    checking for .preinit_array/.init_array/.fini_array support... yes
[CFG  ]    checking whether to use .ctors/.dtors header and trailer... no
[CFG  ]    checking for libunwind-support in compiler... no
[CFG  ]    checking for linker that supports -z nodelete... yes
[CFG  ]    checking for linker that supports -z nodlopen... yes
[CFG  ]    checking for linker that supports -z initfirst... yes
[CFG  ]    configure: WARNING: missing architecture parameter to check for working -z relro
[CFG  ]    checking for -Bgroup option... yes
[CFG  ]    checking whether --noexecstack is desirable for .S files... yes
[CFG  ]    checking for -z combreloc... yes
[CFG  ]    checking for linker that supports -z execstack... yes
[CFG  ]    checking for -fpie... yes
[CFG  ]    checking for --hash-style option... yes
[CFG  ]    checking for sufficient default -shared layout... no
[CFG  ]    checking linker output format... unknown
[CFG  ]    checking for -fno-toplevel-reorder -fno-section-anchors... yes
[CFG  ]    checking for -fstack-protector... yes
[CFG  ]    checking for -fgnu89-inline... yes
[CFG  ]    checking whether cc puts quotes around section names... no
[CFG  ]    checking for assembler .weak directive... yes
[CFG  ]    checking whether CFI directives are supported... yes
[CFG  ]    checking for ld --no-whole-archive... yes
[CFG  ]    checking for gcc -fexceptions... no
[CFG  ]    checking for __builtin_memset... no
[CFG  ]    checking for redirection of built-in functions... yes
[CFG  ]    checking for __thread... yes
[CFG  ]    checking for tls_model attribute... yes
[CFG  ]    checking for compiler option to disable generation of FMA instructions...

即:

checking add-on ports for preconfigure fragments… aarch64 alpha am33 arm arm/preconfigure: Did not find ARM architecture type; using default

【解决过程】

1.去搜了搜,看到:

GNU C Library master sources branch roland/arm-preconfigure created. glibc-2.17-370-g0559cee

中有:

diff --git a/ports/sysdeps/arm/preconfigure b/ports/sysdeps/arm/preconfigure
index 6d61b14..0042aaf 100644
--- a/ports/sysdeps/arm/preconfigure
+++ b/ports/sysdeps/arm/preconfigure
@@ -1,53 +1,58 @@
+# This file is generated from configure.in by Autoconf.  DO NOT EDIT!
+ # Local preconfigure fragment for sysdeps/arm
 
-		  machine=arm
-		  echo 2>&1 "arm/preconfigure: Did not find ARM architecture type; using default"
-		  ;;
-		esac
+  x__ARM_ARCH_6T2__)
+    machine=armv6t2
+    { $as_echo "$as_me:${as_lineno-$LINENO}: Found compiler is configured for $machine" >&5
+$as_echo "$as_me: Found compiler is configured for $machine" >&6;}
+    ;;
+  x__ARM_ARCH_6*__)
+    machine=armv6
+    { $as_echo "$as_me:${as_lineno-$LINENO}: Found compiler is configured for $machine" >&5
+$as_echo "$as_me: Found compiler is configured for $machine" >&6;}
+    ;;
+  *)
+    machine=arm
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: arm/preconfigure: Did not find ARM architecture type; using default" >&5
+$as_echo "$as_me: WARNING: arm/preconfigure: Did not find ARM architecture type; using default" >&2;}
+    ;;
+  esac
 
+    machine=arm
+    AC_MSG_WARN([arm/preconfigure: Did not find ARM architecture type; using default])
+    ;;
+  esac
+
+  machine=arm/$machine
+esac

很明显,其中是对于libc-ports新加的配置内容。

2.然后注意到,此处应该是:

eglibc中的(用到的?)libc,其附属东西:

ports

部分,出现这个问题的。

然后参考上面的patch,去找到了:

E:\dev_install_root\cygwin\home\develop\crosstool-ng\crosstool-ng-1.18.0_build\.build\src\eglibc-2_17\ports\sysdeps\arm\preconfigure

中,的确有这部分的配置内容:

case "$machine" in
arm*)
	base_machine=arm
	case $config_os in
	linux-gnueabi*)
		# Lets ask the compiler which ARM family we've got
		# Unfortunately it doesn't define any flags for implementations
		# that you might pass to -mcpu or -mtune
		# Note if you add patterns here you must ensure that
		# an appropriate directory exists in sysdeps/arm
		archcppflag=`echo "" |
		$CC $CFLAGS $CPPFLAGS -E -dM - |
		  grep __ARM_ARCH |
		  sed -e 's/^#define //' -e 's/ .*//'`

		case x$archcppflag in
		x__ARM_ARCH_[89]*__)
		  machine=armv7
		  echo "Found compiler is configured for something newer than v7 - using v7"
		  ;;

		x__ARM_ARCH_7A__)
		  machine=armv7
		  echo "Found compiler is configured for $machine"
		  ;;

		x__ARM_ARCH_6T2__)
		  machine=armv6t2
		  echo "Found compiler is configured for $machine"
		  ;;

		*)
		  machine=arm
		  echo 2>&1 "arm/preconfigure: Did not find ARM architecture type; using default"
		  ;;
		esac

		machine=arm/$machine
		if [ "${CFLAGS+set}" != "set" ]; then
		  CFLAGS="-g -O2"
		fi
		CFLAGS="$CFLAGS -fno-unwind-tables"
		;;
	linux*)
		echo "Old ABI no longer supported" 2>&1
		exit 1
		;;
	esac
	;;
esac

但是,还是不知道如何避免此问题。

不知道,想要添加armv4的话,如何添加。

还是要换用别的,更新的那个版本的eglibc?

还是换用别的版本的libc?

2.对于此问题,去搜,结果竟然发现,自己的帖子:

【或许解决】cygwin中编译crosstool-ng在Installing C library headers & start files阶段出错:configure: error: support for the tls_model attribute is required

中,就已经出现了此警告:

[CFG  ]    checking add-on ports for preconfigure fragments... aarch64 alpha am33 arm cc1: warning: switch -mcpu=arm9tdmi conflicts with -march= switch

[CFG  ]    arm/preconfigure: Did not find ARM architecture type; using default

所以是:

之前mcpu和march冲突,就已经出现此问题

但是上述帖子中,没解决掉此问题。

此处还是出现了此警告,但是却是由于内部配置文件中本身就不支持armv4t(只支持armv7,armv6t2)

结果还是无法解决此问题。

3.看到该贴的回复:

Re: [ARM] architecture specific subdirectories & optimised memchr [V3]

的解释:

The usual way to do this sort of thing is by using --with-cpu at configure
time.

虽然没完全看懂,但是觉得说的有理,应该是通过配置得到的,而不是此处弄个preconfigure去搞得armv4t都不支持。。

 

【总结】

算了,还是没找到解决办法,暂且还是凑合用吧。

继续去编译。



发表评论

电子邮件地址不会被公开。 必填项已用*标注

无觅相关文章插件,快速提升流量