Some fix for cross-build-native:
debian/patches/ada-libgnatvsn.diff:
Should use the CC from build/Makefile, which will pass it CC correct.
debian/patches/cross-build-native.diff
patch src/libcc1/configure.ac
libcc1 use gcc_cv_objdump, while it is not set at all.
Use the same snap of code from src/gcc/configure.ac
Patch src/libgo/runtime/go-main.c
then main() has a return value `int', while it returns NULL,
and ... NULL is defined as (void *)0, in stddefs.h
debian/rules2 b/debian/rules2
when building gccjit for cross-build-native, it should be the same with
DEB_CROSS was set.
Know issue:
for ppc64el, libgomp1 will lost *some* of acc_* symbols, not all.
No idea why.
The package list of env is also attached.
On Sun, Sep 13, 2015 at 9:23 PM, YunQiang Su <wzssyqa@gmail.com> wrote:
> Some more fix to debian/rules.d/binary-ada.mk.
>
> On Sat, 12 Sep 2015 23:56:13 +0800 YunQiang Su <wzssyqa@gmail.com> wrote:
>> Package: src:gcc-5
>> Version: 5.2.1-17
>>
>> I rewrite gnat sjlj support with a new src/libada-sjlj directory added,
>> instead of the huge patch to src/gcc/ada/gcc-interfaces/Makefile.in.
>>
>> 0001_libgnatvsn-prj.diff
>> as we build libgnatsvn/libgnatprj in build/TRIPLET, so fix something
>> left.
>>
>> 0002_ada-sjlj.diff
>> Rewrite gnat sjlj support, with a new added directory.
>> It still builds zcx in build/gcc/ada/rts (not rts-natvie),
>> while builds sjlj in build/gcc/ada/rts-sjlj.
>> Some dependency chains ins Makefile.def are also got some change.
>> ada-acats-sjlj.diff is not needed any more, as with this method of build,
>> the upstream test just works.
>>
>> 0003_prepare-ada-cross-support.diff
>> This is some changes for cross gnat support.
>> Make package priority extra when cross build instead of optional.
>> gcc-5-cross asks for it?
>> dependencies = { module=all-target-libgnatvsn;
>> on=all-target-libstdc++-v3; };
>> in fact libgnatprj requires some header files of libstdc++,
>> no idea whether libgnatprj does.
>> since libgnatprj depends on libgnatvsn, so add
>> libgnatvsn here.
>> This is found when cross build for mipsel
>> TOOLS_LIBS: change the order and add stdc++ here.
>> on some architecture, the old order doesn't work.
>> now idea why.
>> this order just work for all architecture in the
>> list of gcc-5-cross.
>> Maybe you still wish to disable ada cross by default here.
>>
>>
>> --
>> YunQiang Su
--
YunQiang Su
diff --git a/debian/patches/ada-libgnatvsn.diff b/debian/patches/ada-libgnatvsn.diff index 222b4ab..980fc37 100644 --- a/debian/patches/ada-libgnatvsn.diff +++ b/debian/patches/ada-libgnatvsn.diff @@ -91,7 +91,7 @@ Index: b/src/libgnatvsn/Makefile.in +LIB_VERSION := $(strip $(shell grep ' Library_Version :' \ + @srcdir@/../gcc/ada/gnatvsn.ads | \ + sed -e 's/.*"\(.*\)".*/\1/')) -+GCC:=../../gcc/xgcc -B../../gcc/ -B/usr/@host@/lib ++GCC:=$(CC) +LIBGNAT_JUST_BUILT := -nostdinc -I../../gcc/ada/rts +CFLAGS := -g -O2 -gnatn +FULLVER := $(shell cat @srcdir@/../gcc/FULL-VER) diff --git a/debian/patches/cross-build-native.diff b/debian/patches/cross-build-native.diff new file mode 100644 index 0000000..66bfc8c --- /dev/null +++ b/debian/patches/cross-build-native.diff @@ -0,0 +1,49 @@ +Index: gcc-5-5.2.1/src/libcc1/configure.ac +=================================================================== +--- gcc-5-5.2.1.orig/src/libcc1/configure.ac ++++ gcc-5-5.2.1/src/libcc1/configure.ac +@@ -63,6 +63,31 @@ if test "$GXX" = yes; then + fi + AC_SUBST(libsuffix) + ++# Figure out what objdump we will be using. ++AS_VAR_SET_IF(gcc_cv_objdump,, [ ++if test -f $gcc_cv_binutils_srcdir/configure.in \ ++ && test -f ../binutils/Makefile \ ++ && test x$build = x$host; then ++ # Single tree build which includes binutils. ++ gcc_cv_objdump=../binutils/objdump$build_exeext ++elif test -x objdump$build_exeext; then ++ gcc_cv_objdump=./objdump$build_exeext ++elif ( set dummy $OBJDUMP_FOR_TARGET; test -x $[2] ); then ++ gcc_cv_objdump="$OBJDUMP_FOR_TARGET" ++else ++ AC_PATH_PROG(gcc_cv_objdump, $OBJDUMP_FOR_TARGET) ++fi]) ++ ++AC_MSG_CHECKING(what objdump to use) ++if test "$gcc_cv_objdump" = ../binutils/objdump$build_exeext; then ++ # Single tree build which includes binutils. ++ AC_MSG_RESULT(newly built objdump) ++elif test x$gcc_cv_objdump = x; then ++ AC_MSG_RESULT(not found) ++else ++ AC_MSG_RESULT($gcc_cv_objdump) ++fi ++ + dnl Test for -lsocket and -lnsl. Copied from libgo/configure.ac. + AC_CACHE_CHECK([for socket libraries], libcc1_cv_lib_sockets, + [libcc1_cv_lib_sockets= +Index: gcc-5-5.2.1/src/libgo/runtime/go-main.c +=================================================================== +--- gcc-5-5.2.1.orig/src/libgo/runtime/go-main.c ++++ gcc-5-5.2.1/src/libgo/runtime/go-main.c +@@ -38,7 +38,7 @@ main (int argc, char **argv) + runtime_isarchive = false; + + if (runtime_isstarted) +- return NULL; ++ return 0; + runtime_isstarted = true; + + runtime_check (); diff --git a/debian/rules.patch b/debian/rules.patch index 5b3f62d..588c751 100644 --- a/debian/rules.patch +++ b/debian/rules.patch @@ -323,6 +323,7 @@ debian_patches += ada-mips debian_patches += ada-ppc64 debian_patches += ada-mips64 debian_patches += ada-bootstrap-compare +debian_patches += cross-build-native # don't remove, this is regularly overwritten, see PR sanitizer/63958. #debian_patches += libasan-sparc diff --git a/debian/rules2 b/debian/rules2 index efec45d..95f930a 100644 --- a/debian/rules2 +++ b/debian/rules2 @@ -1274,6 +1274,9 @@ endif ifeq ($(DEB_CROSS),yes) BUILT_CC = $(CC) BUILT_CXX = $(CXX) +else ifneq (,$(filter $(build_type), cross-build-native)) + BUILT_CC = $(CC) + BUILT_CXX = $(CXX) else BUILT_CC = $(builddir)/gcc/xgcc -B$(builddir)/gcc/ BUILT_CXX = $(builddir)/gcc/xg++ -B$(builddir)/gcc/ \
Attachment:
packages.list
Description: Binary data