update gcc to 13.2.0 and binutils to 2.41
continuous-integration/drone Build is failing Details

This commit is contained in:
PeroSar 2023-09-24 12:24:48 +05:30
parent 917494dda3
commit 40541cc651
9 changed files with 331 additions and 5 deletions

View File

@ -18,4 +18,14 @@ steps:
- bash emerald-gcc.sh
- bash emerald-post-gcc-build.sh
- env XZ_OPT="-9 -T0" tar -C /tmp -cJf aarch64-linux-android-emerald.tar.xz aarch64-linux-android-emerald
- curl -F file=@aarch64-linux-android-emerald.tar.xz 0x0.st
- name: release
image: tystuyfzand/drone-gitea-release
settings:
gitea_server: https://tildegit.org
tag_file: tag.txt
title_file: title.txt
files: [ 'aarch64-linux-android-emerald.tar.xz' ]
environment:
PLUGIN_API_KEY:
from_secret: gitea_token

View File

@ -4,8 +4,8 @@ set -euo pipefail
EMERALD_SCRIPT_DIR=$(dirname "$(realpath "$0")")
BINUTILS_VER=2.38
BINUTILS_SHA256=e316477a914f567eccc34d5d29785b8b0f5a10208d36bbacedcc39048ecfe024
BINUTILS_VER=2.41
BINUTILS_SHA256=ae9a5789e23459e59606e6714723f2d3ffc31c03174191ef0d015bdf06007450
source "$EMERALD_SCRIPT_DIR"/common.sh

View File

@ -4,8 +4,8 @@ set -euo pipefail
EMERALD_SCRIPT_DIR=$(dirname "$(realpath "$0")")
GCC_VER=12.1.0
GCC_SHA256=62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b
GCC_VER=13.2.0
GCC_SHA256=e275e76442a6067341a27f04c5c6b83d8613144004c0413528863dc6b5c743da
source "$EMERALD_SCRIPT_DIR"/common.sh

View File

@ -0,0 +1,69 @@
--- /dev/null 2022-03-10 14:56:30.584000000 +1100
+++ gcc/config/aarch64/aarch64-linux-android.h 2022-04-26 15:48:56.533607085 +1000
@@ -0,0 +1,66 @@
+/* Machine description for AArch64 architecture.
+ Copyright (C) 2014 Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ GCC is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef GCC_AARCH64_LINUX_ANDROID_H
+#define GCC_AARCH64_LINUX_ANDROID_H
+
+
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ GNU_USER_TARGET_OS_CPP_BUILTINS(); \
+ ANDROID_TARGET_OS_CPP_BUILTINS(); \
+ } \
+ while (0)
+
+#undef LINK_SPEC
+#define LINK_SPEC \
+ LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \
+ LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC)
+
+#undef CC1_SPEC
+#define CC1_SPEC \
+ LINUX_OR_ANDROID_CC (GNU_USER_TARGET_CC1_SPEC, \
+ GNU_USER_TARGET_CC1_SPEC " " ANDROID_CC1_SPEC("-fpic"))
+
+#define CC1PLUS_SPEC \
+ LINUX_OR_ANDROID_CC ("", ANDROID_CC1PLUS_SPEC)
+
+#undef LIB_SPEC
+#define LIB_SPEC \
+ LINUX_OR_ANDROID_LD (GNU_USER_TARGET_LIB_SPEC, \
+ GNU_USER_TARGET_NO_PTHREADS_LIB_SPEC " " ANDROID_LIB_SPEC)
+
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC \
+ LINUX_OR_ANDROID_LD (GNU_USER_TARGET_STARTFILE_SPEC, ANDROID_STARTFILE_SPEC)
+
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC \
+ LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC)
+
+#ifdef IN_LIBGCC2
+#define LIBGCC2_UNWIND_ATTRIBUTE __attribute__((visibility("default")))
+#endif
+
+#define STARTFILE_PREFIX_SPEC \
+ "/usr/lib/"
+
+#endif /* GCC_AARCH64_LINUX_ANDROID_H */

View File

@ -0,0 +1,20 @@
--- gcc/config/aarch64/aarch64-linux.h.bak 2022-04-26 15:37:28.201223209 +1000
+++ gcc/config/aarch64/aarch64-linux.h 2022-04-26 15:40:40.671532123 +1000
@@ -21,7 +21,16 @@
#ifndef GCC_AARCH64_LINUX_H
#define GCC_AARCH64_LINUX_H
-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
+#ifndef RUNTIME_ROOT_PREFIX
+#define RUNTIME_ROOT_PREFIX ""
+#endif
+
+#define GLIBC_DYNAMIC_LINKER RUNTIME_ROOT_PREFIX "/lib/ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
+
+#ifdef BIONIC_DYNAMIC_LINKER
+#undef BIONIC_DYNAMIC_LINKER
+#endif
+#define BIONIC_DYNAMIC_LINKER RUNTIME_ROOT_PREFIX "/system/bin/linker64"
#undef MUSL_DYNAMIC_LINKER
#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"

View File

@ -0,0 +1,26 @@
--- gcc/config/linux-android.h.bak 2022-04-26 15:52:59.964626084 +1000
+++ gcc/config/linux-android.h 2022-04-26 15:59:36.466061086 +1000
@@ -44,15 +44,18 @@
"%{" NOANDROID "|tno-android-ld:" LINUX_SPEC ";:" ANDROID_SPEC "}"
#define ANDROID_LINK_SPEC \
- "%{shared: -Bsymbolic}"
+ "%{shared: -Bsymbolic} -z noexecstack -z relro -z now"
-#define ANDROID_CC1_SPEC \
+#define ANDROID_CC1_SPEC(ANDROID_PIC_DEFAULT) \
"%{!mglibc:%{!muclibc:%{!mbionic: -mbionic}}} " \
- "%{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC: -fPIC}}}}"
+ "%{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC: " ANDROID_PIC_DEFAULT "}}}}"
#define ANDROID_CC1PLUS_SPEC \
- "%{!fexceptions:%{!fno-exceptions: -fno-exceptions}} " \
- "%{!frtti:%{!fno-rtti: -fno-rtti}}"
+ "%{!fexceptions:%{!fno-exceptions: -fexceptions}} " \
+ "%{!frtti:%{!fno-rtti: -frtti}}"
+
+#define ANDROID_ASM_SPEC \
+ "--noexecstack"
#define ANDROID_LIB_SPEC \
"%{!static: -ldl}"

View File

@ -0,0 +1,23 @@
--- gcc/config.gcc.bak 2023-09-24 05:57:10.995496760 +0000
+++ gcc/config.gcc 2023-09-24 06:03:25.199104067 +0000
@@ -1145,6 +1145,9 @@
aarch64_be-*)
tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
;;
+ aarch64*-*-linux-android*)
+ tm_file="${tm_file} aarch64/aarch64-linux-android.h"
+ ;;
esac
aarch64_multilibs="${with_multilib_list}"
if test "$aarch64_multilibs" = "default"; then
@@ -1176,8 +1179,9 @@
extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
;;
aarch64*-*-linux*)
- tm_file="${tm_file} elfos.h gnu-user.h linux.h glibc-stdint.h"
+ tm_file="${tm_file} elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h"
tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-errata.h aarch64/aarch64-linux.h"
+ extra_options="${extra_options} linux-android.opt"
tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-linux"
tm_defines="${tm_defines} TARGET_DEFAULT_ASYNC_UNWIND_TABLES=1"
case $target in

View File

@ -0,0 +1,153 @@
--- gcc/system.h.bak 2022-04-26 16:18:06.956629449 +1000
+++ gcc/system.h 2022-04-26 16:21:36.747332234 +1000
@@ -50,150 +50,6 @@
#define NULL 0
#endif
-/* Use the unlocked open routines from libiberty. */
-
-/* Some of these are #define on some systems, e.g. on AIX to redirect
- the names to 64bit capable functions for LARGE_FILES support. These
- redefs are pointless here so we can override them. */
-
-#undef fopen
-#undef freopen
-
-#define fopen(PATH, MODE) fopen_unlocked (PATH, MODE)
-#define fdopen(FILDES, MODE) fdopen_unlocked (FILDES, MODE)
-#define freopen(PATH, MODE, STREAM) freopen_unlocked (PATH, MODE, STREAM)
-
-/* The compiler is not a multi-threaded application and therefore we
- do not have to use the locking functions. In fact, using the locking
- functions can cause the compiler to be significantly slower under
- I/O bound conditions (such as -g -O0 on very large source files).
-
- HAVE_DECL_PUTC_UNLOCKED actually indicates whether or not the stdio
- code is multi-thread safe by default. If it is set to 0, then do
- not worry about using the _unlocked functions.
-
- fputs_unlocked, fwrite_unlocked, and fprintf_unlocked are
- extensions and need to be prototyped by hand (since we do not
- define _GNU_SOURCE). */
-
-#if defined HAVE_DECL_PUTC_UNLOCKED && HAVE_DECL_PUTC_UNLOCKED
-
-# ifdef HAVE_PUTC_UNLOCKED
-# undef putc
-# define putc(C, Stream) putc_unlocked (C, Stream)
-# endif
-# ifdef HAVE_PUTCHAR_UNLOCKED
-# undef putchar
-# define putchar(C) putchar_unlocked (C)
-# endif
-# ifdef HAVE_GETC_UNLOCKED
-# undef getc
-# define getc(Stream) getc_unlocked (Stream)
-# endif
-# ifdef HAVE_GETCHAR_UNLOCKED
-# undef getchar
-# define getchar() getchar_unlocked ()
-# endif
-# ifdef HAVE_FPUTC_UNLOCKED
-# undef fputc
-# define fputc(C, Stream) fputc_unlocked (C, Stream)
-# endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-# ifdef HAVE_CLEARERR_UNLOCKED
-# undef clearerr
-# define clearerr(Stream) clearerr_unlocked (Stream)
-# if defined (HAVE_DECL_CLEARERR_UNLOCKED) && !HAVE_DECL_CLEARERR_UNLOCKED
-extern void clearerr_unlocked (FILE *);
-# endif
-# endif
-# ifdef HAVE_FEOF_UNLOCKED
-# undef feof
-# define feof(Stream) feof_unlocked (Stream)
-# if defined (HAVE_DECL_FEOF_UNLOCKED) && !HAVE_DECL_FEOF_UNLOCKED
-extern int feof_unlocked (FILE *);
-# endif
-# endif
-# ifdef HAVE_FILENO_UNLOCKED
-# undef fileno
-# define fileno(Stream) fileno_unlocked (Stream)
-# if defined (HAVE_DECL_FILENO_UNLOCKED) && !HAVE_DECL_FILENO_UNLOCKED
-extern int fileno_unlocked (FILE *);
-# endif
-# endif
-# ifdef HAVE_FFLUSH_UNLOCKED
-# undef fflush
-# define fflush(Stream) fflush_unlocked (Stream)
-# if defined (HAVE_DECL_FFLUSH_UNLOCKED) && !HAVE_DECL_FFLUSH_UNLOCKED
-extern int fflush_unlocked (FILE *);
-# endif
-# endif
-# ifdef HAVE_FGETC_UNLOCKED
-# undef fgetc
-# define fgetc(Stream) fgetc_unlocked (Stream)
-# if defined (HAVE_DECL_FGETC_UNLOCKED) && !HAVE_DECL_FGETC_UNLOCKED
-extern int fgetc_unlocked (FILE *);
-# endif
-# endif
-# ifdef HAVE_FGETS_UNLOCKED
-# undef fgets
-# define fgets(S, n, Stream) fgets_unlocked (S, n, Stream)
-# if defined (HAVE_DECL_FGETS_UNLOCKED) && !HAVE_DECL_FGETS_UNLOCKED
-extern char *fgets_unlocked (char *, int, FILE *);
-# endif
-# endif
-# ifdef HAVE_FPUTS_UNLOCKED
-# undef fputs
-# define fputs(String, Stream) fputs_unlocked (String, Stream)
-# if defined (HAVE_DECL_FPUTS_UNLOCKED) && !HAVE_DECL_FPUTS_UNLOCKED
-extern int fputs_unlocked (const char *, FILE *);
-# endif
-# endif
-# ifdef HAVE_FERROR_UNLOCKED
-# undef ferror
-# define ferror(Stream) ferror_unlocked (Stream)
-# if defined (HAVE_DECL_FERROR_UNLOCKED) && !HAVE_DECL_FERROR_UNLOCKED
-extern int ferror_unlocked (FILE *);
-# endif
-# endif
-# ifdef HAVE_FREAD_UNLOCKED
-# undef fread
-# define fread(Ptr, Size, N, Stream) fread_unlocked (Ptr, Size, N, Stream)
-# if defined (HAVE_DECL_FREAD_UNLOCKED) && !HAVE_DECL_FREAD_UNLOCKED
-extern size_t fread_unlocked (void *, size_t, size_t, FILE *);
-# endif
-# endif
-# ifdef HAVE_FWRITE_UNLOCKED
-# undef fwrite
-# define fwrite(Ptr, Size, N, Stream) fwrite_unlocked (Ptr, Size, N, Stream)
-# if defined (HAVE_DECL_FWRITE_UNLOCKED) && !HAVE_DECL_FWRITE_UNLOCKED
-extern size_t fwrite_unlocked (const void *, size_t, size_t, FILE *);
-# endif
-# endif
-# ifdef HAVE_FPRINTF_UNLOCKED
-# undef fprintf
-/* We can't use a function-like macro here because we don't know if
- we have varargs macros. */
-# define fprintf fprintf_unlocked
-# if defined (HAVE_DECL_FPRINTF_UNLOCKED) && !HAVE_DECL_FPRINTF_UNLOCKED
-extern int fprintf_unlocked (FILE *, const char *, ...);
-# endif
-# endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
-/* ??? Glibc's fwrite/fread_unlocked macros cause
- "warning: signed and unsigned type in conditional expression". */
-#undef fread_unlocked
-#undef fwrite_unlocked
-
/* Include <string> before "safe-ctype.h" to avoid GCC poisoning
the ctype macros through safe-ctype.h */

View File

@ -0,0 +1,25 @@
--- libstdc++-v3/config/os/bionic/ctype_base.h.bak 2022-04-27 12:37:53.088346124 +0000
+++ libstdc++-v3/config/os/bionic/ctype_base.h 2022-04-27 12:39:38.444403143 +0000
@@ -28,6 +28,22 @@
// Information as gleaned from /usr/include/ctype.h
+#if defined (__ANDROID__)
+#if !defined(_U)
+#if !defined(_CTYPE_U)
+#error Bionic header ctype.h does not define either _U nor _CTYPE_U
+#endif
+#define _U _CTYPE_U
+#define _L _CTYPE_L
+#define _N _CTYPE_N
+#define _S _CTYPE_S
+#define _P _CTYPE_P
+#define _C _CTYPE_C
+#define _X _CTYPE_X
+#define _B _CTYPE_B
+#endif
+#endif /* __ANDROID__ */
+
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION