Merge pull request #373 from stilor/unbreak-ppc-uclibc

Unbreak samples
This commit is contained in:
Bryan Hundven 2016-05-12 20:34:42 -07:00
commit cd39285ff8
12 changed files with 75 additions and 18 deletions

View File

@ -74,7 +74,7 @@ choice
config LIBC_GLIBC_V_2_23 config LIBC_GLIBC_V_2_23
bool bool
prompt "2.23" prompt "2.23"
select LIBC_GLIBC_2_20_or_later select LIBC_GLIBC_2_23_or_later
config LIBC_GLIBC_V_2_22 config LIBC_GLIBC_V_2_22
bool bool
@ -109,6 +109,11 @@ endchoice
endif # ! LIBC_GLIBC_CUSTOM endif # ! LIBC_GLIBC_CUSTOM
# Checked by SPARC build: SPARCv8 is dropped in 2.23.
config LIBC_GLIBC_2_23_or_later
select LIBC_GLIBC_2_20_or_later
bool
# DeMark 2.20 as no longer needs to set NPTL as an addon. # DeMark 2.20 as no longer needs to set NPTL as an addon.
# It is no longer possible to build glibc without pthread! # It is no longer possible to build glibc without pthread!
config LIBC_GLIBC_2_20_or_later config LIBC_GLIBC_2_20_or_later

View File

@ -0,0 +1,13 @@
diff -ur dmalloc-5.5.2.orig/return.h dmalloc-5.5.2/return.h
--- dmalloc-5.5.2.orig/return.h 2016-03-13 13:11:48.090431764 -0700
+++ dmalloc-5.5.2/return.h 2016-03-13 13:12:11.246642618 -0700
@@ -251,8 +251,7 @@
#define GET_RET_ADDR(file) \
do { \
- asm("mflr 0"); \
- asm("stw 0,%0" : "=g" (file)); \
+ asm("mflr %0" : "=r"(file)); \
} while(0)
#endif /* __powerpc__ && __GNUC__ && !__OPTIMIZE__ */

View File

@ -0,0 +1,12 @@
diff -ur uClibc-ng-1.0.12.orig/libc/misc/gnu/obstack.c uClibc-ng-1.0.12/libc/misc/gnu/obstack.c
--- uClibc-ng-1.0.12.orig/libc/misc/gnu/obstack.c 2016-03-13 15:08:44.408962824 -0700
+++ uClibc-ng-1.0.12/libc/misc/gnu/obstack.c 2016-03-13 15:13:30.129322998 -0700
@@ -385,7 +385,7 @@
abort ();
}
-# if 0
+# if 1
/* Older versions of libc used a function _obstack_free intended to be
called by non-GCC compilers. */
strong_alias (obstack_free, _obstack_free)

View File

@ -11,4 +11,3 @@ CT_BINUTILS_LD_WRAPPER=y
CT_BINUTILS_PLUGINS=y CT_BINUTILS_PLUGINS=y
CT_CC_LANG_CXX=y CT_CC_LANG_CXX=y
CT_DEBUG_gdb=y CT_DEBUG_gdb=y
CT_GDB_CROSS_EXTRA_CONFIG_ARRAY="--with-expat"

View File

@ -11,4 +11,3 @@ CT_BINUTILS_LD_WRAPPER=y
CT_BINUTILS_PLUGINS=y CT_BINUTILS_PLUGINS=y
CT_CC_LANG_CXX=y CT_CC_LANG_CXX=y
CT_DEBUG_gdb=y CT_DEBUG_gdb=y
CT_GDB_CROSS_EXTRA_CONFIG_ARRAY="--with-expat"

View File

@ -12,4 +12,3 @@ CT_BINUTILS_LD_WRAPPER=y
CT_BINUTILS_PLUGINS=y CT_BINUTILS_PLUGINS=y
CT_CC_LANG_CXX=y CT_CC_LANG_CXX=y
CT_DEBUG_gdb=y CT_DEBUG_gdb=y
CT_GDB_CROSS_EXTRA_CONFIG_ARRAY="--with-expat"

View File

@ -12,4 +12,3 @@ CT_BINUTILS_LD_WRAPPER=y
CT_BINUTILS_PLUGINS=y CT_BINUTILS_PLUGINS=y
CT_CC_LANG_CXX=y CT_CC_LANG_CXX=y
CT_DEBUG_gdb=y CT_DEBUG_gdb=y
CT_GDB_CROSS_EXTRA_CONFIG_ARRAY="--with-expat"

View File

@ -1,6 +1,4 @@
CT_EXPERIMENTAL=y CT_EXPERIMENTAL=y
CT_DEBUG_CT=y
CT_DEBUG_CT_SAVE_STEPS=y
CT_LOCAL_TARBALLS_DIR="${HOME}/src" CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y CT_SAVE_TARBALLS=y
# CT_STRIP_HOST_TOOLCHAIN_EXECUTABLES is not set # CT_STRIP_HOST_TOOLCHAIN_EXECUTABLES is not set

View File

@ -69,7 +69,11 @@ do_debug_gdb_build() {
cross_extra_config=("${extra_config[@]}") cross_extra_config=("${extra_config[@]}")
cross_extra_config+=("--with-expat") cross_extra_config+=("--with-expat")
cross_extra_config+=("--with-libexpat-prefix=${CT_HOST_COMPLIBS_DIR}") # NOTE: DO NOT USE --with-libexpat-prefix (until GDB configure is smarter)!!!
# It conflicts with a static build: GDB's configure script will find the shared
# version of expat and will attempt to link that, despite the -static flag.
# The link will fail, and configure will abort with "expat missing or unusable"
# message.
case "${CT_THREADS}" in case "${CT_THREADS}" in
none) cross_extra_config+=("--disable-threads");; none) cross_extra_config+=("--disable-threads");;
*) cross_extra_config+=("--enable-threads");; *) cross_extra_config+=("--enable-threads");;
@ -88,13 +92,20 @@ do_debug_gdb_build() {
cross_extra_config+=("--disable-nls") cross_extra_config+=("--disable-nls")
fi fi
CC_for_gdb= CC_for_gdb="${CT_HOST}-gcc ${CT_CFLAGS_FOR_HOST} ${CT_LDFLAGS_FOR_HOST}"
LD_for_gdb= LD_for_gdb="${CT_HOST}-ld ${CT_LDFLAGS_FOR_HOST}"
if [ "${CT_GDB_CROSS_STATIC}" = "y" ]; then if [ "${CT_GDB_CROSS_STATIC}" = "y" ]; then
CC_for_gdb="${CT_HOST}-gcc -static" CC_for_gdb+=" -static"
LD_for_gdb="${CT_HOST}-ld -static" LD_for_gdb+=" -static"
fi fi
# Fix up whitespace. Some older GDB releases (e.g. 6.8a) get confused if there
# are multiple consecutive spaces: sub-configure scripts replace them with a
# single space and then complain that $CC value changed from that in
# the master directory.
CC_for_gdb=`echo $CC_for_gdb`
LD_for_gdb=`echo $LD_for_gdb`
# Disable binutils options when building from the binutils-gdb repo. # Disable binutils options when building from the binutils-gdb repo.
cross_extra_config+=("--disable-binutils") cross_extra_config+=("--disable-binutils")
cross_extra_config+=("--disable-ld") cross_extra_config+=("--disable-ld")
@ -162,6 +173,11 @@ do_debug_gdb_build() {
fi fi
native_extra_config+=("--with-expat") native_extra_config+=("--with-expat")
# NOTE: DO NOT USE --with-libexpat-prefix (until GDB configure is smarter)!!!
# It conflicts with a static build: GDB's configure script will find the shared
# version of expat and will attempt to link that, despite the -static flag.
# The link will fail, and configure will abort with "expat missing or unusable"
# message.
CT_DoLog EXTRA "Configuring native gdb" CT_DoLog EXTRA "Configuring native gdb"

View File

@ -73,6 +73,7 @@ do_libc_backend() {
local multi_dir local multi_dir
local multi_flags local multi_flags
local extra_dir local extra_dir
local target
local libc_headers libc_startfiles libc_full local libc_headers libc_startfiles libc_full
local hdr local hdr
local arg local arg
@ -136,11 +137,24 @@ do_libc_backend() {
CT_mkdir_pushd "${CT_BUILD_DIR}/build-libc-${libc_mode}${extra_dir//\//_}" CT_mkdir_pushd "${CT_BUILD_DIR}/build-libc-${libc_mode}${extra_dir//\//_}"
target=${CT_TARGET}
case "${target}" in
# SPARC quirk: glibc 2.23 and newer dropped support for SPARCv8 and
# earlier (corresponding pthread barrier code is missing). Until this
# support is reintroduced, configure as sparcv9.
sparc-*)
if [ "${CT_LIBC_GLIBC_2_23_or_later}" = y ]; then
target=${target/#sparc-/sparcv9-}
fi
;;
esac
do_libc_backend_once extra_dir="${extra_dir}" \ do_libc_backend_once extra_dir="${extra_dir}" \
extra_flags="${extra_flags}" \ extra_flags="${extra_flags}" \
libc_headers="${libc_headers}" \ libc_headers="${libc_headers}" \
libc_startfiles="${libc_startfiles}" \ libc_startfiles="${libc_startfiles}" \
libc_full="${libc_full}" libc_full="${libc_full}" \
target="${target}"
CT_Popd CT_Popd
@ -192,6 +206,7 @@ do_libc_backend_once() {
local glibc_cflags local glibc_cflags
local float_extra local float_extra
local endian_extra local endian_extra
local target
local arg local arg
for arg in "$@"; do for arg in "$@"; do
@ -341,7 +356,7 @@ do_libc_backend_once() {
"${src_dir}/configure" \ "${src_dir}/configure" \
--prefix=/usr \ --prefix=/usr \
--build=${CT_BUILD} \ --build=${CT_BUILD} \
--host=${CT_TARGET} \ --host=${target} \
--cache-file="$(pwd)/config.cache" \ --cache-file="$(pwd)/config.cache" \
--without-cvs \ --without-cvs \
--disable-profile \ --disable-profile \

View File

@ -509,6 +509,8 @@ if [ -z "${CT_RESTART}" ]; then
CT_CFLAGS_FOR_HOST+=" ${CT_EXTRA_CFLAGS_FOR_HOST}" CT_CFLAGS_FOR_HOST+=" ${CT_EXTRA_CFLAGS_FOR_HOST}"
CT_LDFLAGS_FOR_HOST= CT_LDFLAGS_FOR_HOST=
CT_LDFLAGS_FOR_HOST+=" ${CT_EXTRA_LDFLAGS_FOR_HOST}" CT_LDFLAGS_FOR_HOST+=" ${CT_EXTRA_LDFLAGS_FOR_HOST}"
CT_CFLAGS_FOR_HOST+=" -I${CT_HOST_COMPLIBS_DIR}/include"
CT_LDFLAGS_FOR_HOST+=" -L${CT_HOST_COMPLIBS_DIR}/lib"
CT_DoLog DEBUG "CFLAGS for host compiler: '${CT_CFLAGS_FOR_HOST}'" CT_DoLog DEBUG "CFLAGS for host compiler: '${CT_CFLAGS_FOR_HOST}'"
CT_DoLog DEBUG "LDFLAGS for host compiler: '${CT_LDFLAGS_FOR_HOST}'" CT_DoLog DEBUG "LDFLAGS for host compiler: '${CT_LDFLAGS_FOR_HOST}'"