gcc: upgrade gcc for powerpc to version 4.5.0

Fix one parameter order issue for base_contains function,
which impacts glibc build under new gcc.

Add new judge code to determine whether <altivec.h> is needed.
This fixes the mpeg2dec build failure under new gcc.

Use O2 as the optimization flag to tinylogin as it will meet
segfault if compiled by gcc-4.5.0 when enable both frename-registers
and Os options. Use O2 instead.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
This commit is contained in:
Dongxiao Xu 2010-09-16 13:51:09 +08:00 committed by Saul Wold
parent 8e9caafd0b
commit 0ff070bbf1
27 changed files with 89 additions and 27 deletions

View File

@ -16,7 +16,6 @@ PREFERRED_PROVIDER_virtual/${SDK_PREFIX}libc-for-gcc-nativesdk ?= "${POKYLIBC}-n
GCCVERSION ?= "4.5.0"
GCCVERSION_powerpc ?= "4.3.3"
GCCVERSION_mips ?= "4.3.3"
SDKGCCVERSION ?= "4.5.0"
BINUVERSION ?= "2.20.1"

View File

@ -0,0 +1,19 @@
tinylogin will meet segment fault if compiled by gcc-4.5.0 when enable both
frename-registers and Os options. Use O2 instead.
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
diff -ruN tinylogin-1.4-orig/Makefile tinylogin-1.4/Makefile
--- tinylogin-1.4-orig/Makefile 2010-09-16 13:02:06.302192295 +0800
+++ tinylogin-1.4/Makefile 2010-09-16 13:02:34.634167846 +0800
@@ -97,9 +97,7 @@
#--------------------------------------------------------
-# use '-Os' optimization if available, else use -O2
-OPTIMIZATION = $(shell if $(CC) -Os -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \
- then echo "-Os"; else echo "-O2" ; fi)
+OPTIMIZATION = -O2
WARNINGS = -Wall

View File

@ -5,13 +5,14 @@ changing passwords, and otherwise maintaining users \
and groups on an embedded system."
HOMEPAGE = "http://tinylogin.busybox.net/"
LICENSE = "GPL"
PR = "r4"
PR = "r5"
SRC_URI = "http://tinylogin.busybox.net/downloads/tinylogin-${PV}.tar.bz2 \
file://cvs-20040608.patch;patch=1;pnum=1 \
file://add-system.patch;patch=1;pnum=1 \
file://adduser-empty_pwd.patch;patch=1 \
file://remove-index.patch;patch=1"
file://remove-index.patch;patch=1 \
file://use_O2_option.patch"
EXTRA_OEMAKE = ""

View File

@ -17,7 +17,8 @@ LANGUAGES ?= "c,c++${FORTRAN}${JAVA}"
# hidden symbols in libgcc.a which linker complains
# when linking shared libraries further in the build like (gnutls)
OPTSPACE = "${@base_contains('TARGET_ARCH', ['powerpc', 'arm'], '', '--enable-target-optspace',d)}"
SPECIAL_ARCH_LIST = "powerpc arm"
OPTSPACE = ${@base_contains("SPECIAL_ARCH_LIST", "${TARGET_ARCH}", "", "--enable-target-optspace",d)}
EXTRA_OECONF_BASE ?= ""
EXTRA_OECONF_PATHS ?= ""

View File

@ -5,7 +5,7 @@ require gcc-cross-canadian.inc
require gcc-configure-sdk.inc
require gcc-package-sdk.inc
PR = "r17"
PR = "r18"
DEPENDS += "gmp-nativesdk mpfr-nativesdk"
RDEPENDS_${PN} += "mpfr-nativesdk"

View File

@ -5,7 +5,7 @@ require gcc-cross-canadian.inc
require gcc-configure-sdk.inc
require gcc-package-sdk.inc
PR = "r6"
PR = "r7"
DEPENDS += "gmp-nativesdk mpfr-nativesdk libmpc-nativesdk elfutils-nativesdk"
RDEPENDS_${PN} += "mpfr-nativesdk libmpc-nativesdk elfutils-nativesdk"

View File

@ -1,5 +1,5 @@
require gcc-cross_${PV}.bb
require gcc-cross-initial.inc
PR = "r2"
PR = "r3"

View File

@ -1,5 +1,5 @@
require gcc-cross_${PV}.bb
require gcc-cross-initial.inc
PR = "r7"
PR = "r8"

View File

@ -1,4 +1,4 @@
require gcc-cross_${PV}.bb
require gcc-cross-intermediate.inc
PR = "r2"
PR = "r3"

View File

@ -1,4 +1,4 @@
require gcc-cross_${PV}.bb
require gcc-cross-intermediate.inc
PR = "r7"
PR = "r8"

View File

@ -9,7 +9,7 @@ require gcc-cross-kernel.inc
DEFAULT_PREFERENCE = "-1"
PR = "r2"
PR = "r3"
SRC_URI += "file://gcc-3.4.4-makefile-fix.patch;patch=1"

View File

@ -1,4 +1,4 @@
PR = "r15"
PR = "r16"
require gcc-${PV}.inc
require gcc-cross4.inc

View File

@ -1,4 +1,4 @@
PR = "r7"
PR = "r8"
require gcc-${PV}.inc
require gcc-cross4.inc

View File

@ -1,4 +1,4 @@
PR = "r3"
PR = "r4"
require gcc-csl-arm-2008q1.inc
require gcc-cross4.inc

View File

@ -1,3 +1,3 @@
require gcc-cross-initial_${PV}.bb
require gcc-crosssdk-initial.inc
PR = "r3"
PR = "r4"

View File

@ -1,4 +1,4 @@
require gcc-cross-initial_${PV}.bb
require gcc-crosssdk-initial.inc
PR = "r7"
PR = "r8"

View File

@ -1,3 +1,3 @@
require gcc-cross-intermediate_${PV}.bb
require gcc-crosssdk-intermediate.inc
PR = "r6"
PR = "r7"

View File

@ -1,4 +1,4 @@
require gcc-cross-intermediate_${PV}.bb
require gcc-crosssdk-intermediate.inc
PR = "r7"
PR = "r8"

View File

@ -1,3 +1,3 @@
require gcc-cross_${PV}.bb
require gcc-crosssdk.inc
PR="r1"
PR="r2"

View File

@ -1,4 +1,4 @@
require gcc-cross_${PV}.bb
require gcc-crosssdk.inc
PR = "r7"
PR = "r8"

View File

@ -1,4 +1,4 @@
PR = "r15"
PR = "r16"
require gcc-${PV}.inc
require gcc-configure-runtime.inc

View File

@ -1,4 +1,4 @@
PR = "r6"
PR = "r7"
require gcc-${PV}.inc
require gcc-configure-runtime.inc

View File

@ -1,4 +1,4 @@
PR = "r8"
PR = "r9"
require gcc-${PV}.inc
require gcc-configure-target.inc

View File

@ -1,4 +1,4 @@
PR = "r6"
PR = "r7"
require gcc-${PV}.inc
require gcc-configure-target.inc

View File

@ -1,4 +1,4 @@
PR = "r1"
PR = "r2"
require gcc-${PV}.inc
require gcc-configure-target.inc

View File

@ -0,0 +1,41 @@
Add new method to judge whether <altivec.h> is needed
The original logic will use "typedef vector int t;" to judge
whether <altivec.h> is needed. altivec.h contains the following
statement:
#if !defined(__APPLE_ALTIVEC__)
#define vector __vector
#define pixel __pixel
#define bool
#endif
In gcc-4.3.3, __APPLE_ALTIVEC__ is not defined by compiler, neither
as vector, pixel, and bool. In order to make "typedef vector int t;"
pass the compilation, we need to include altivec.h.
However in gcc-4.5.0, __APPLE_ALTIVEC__ is defined by compiler,
so as vector, pixel, and bool. We could not judge whether
altivec.h is needed by "typedef vector int t;".
Here we include another statement "int tmp = __CR6_EQ;", in
which __CR6_EQ is defined in altivec.h.
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
diff -ruN mpeg2dec-0.4.1-orig/configure.in mpeg2dec-0.4.1/configure.in
--- mpeg2dec-0.4.1-orig/configure.in 2010-09-14 20:55:42.399687663 +0800
+++ mpeg2dec-0.4.1/configure.in 2010-09-14 20:56:43.403204648 +0800
@@ -75,11 +75,11 @@
CFLAGS="$OPT_CFLAGS $TRY_CFLAGS $CFLAGS"
AC_MSG_CHECKING([if <altivec.h> is needed])
AC_TRY_COMPILE([],
- [typedef vector int t;
+ [typedef vector int t; int tmp = __CR6_EQ;
vec_ld(0, (unsigned char *)0);],
[have_altivec=yes; AC_MSG_RESULT(no)],
[AC_TRY_COMPILE([#include <altivec.h>],
- [typedef vector int t; vec_ld(0, (unsigned char *)0);],
+ [typedef vector int t; int tmp = __CR6_EQ; vec_ld(0, (unsigned char *)0);],
[AC_DEFINE([HAVE_ALTIVEC_H],,
[Define to 1 if you have the <altivec.h> header.])
have_altivec=yes; AC_MSG_RESULT(yes)],

View File

@ -8,9 +8,10 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
DEPENDS = "virtual/libx11"
PR = "r0"
PR = "r1"
SRC_URI = "http://libmpeg2.sourceforge.net/files/mpeg2dec-${PV}.tar.gz"
SRC_URI = "http://libmpeg2.sourceforge.net/files/mpeg2dec-${PV}.tar.gz \
file://altivec_h_needed.patch"
inherit autotools pkgconfig