[haiku-commits] Change in buildtools[master]: WIP Redo gcc AARCH64 config, help wanted

  • From: Gerrit <review@xxxxxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 27 Feb 2021 07:47:02 +0000

From Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>:

Fredrik Holmqvist has uploaded this change for review. ( 
https://review.haiku-os.org/c/buildtools/+/3754 ;)


Change subject: WIP Redo gcc AARCH64 config, help wanted
......................................................................

WIP Redo gcc AARCH64 config, help wanted

Not sure how to do this properly.
There are problems with building for ARM64.
Like libroot not finding libgcc_s.1? when cross-compiling
and therefore have undefined unwind symbols.

Anyone have skills/opinions in how to setup GCC for AARCH64
before we get to far in bootstrapping? Help Wanted!
---
M gcc/gcc/config/aarch64/aarch64-haiku.h
1 file changed, 19 insertions(+), 34 deletions(-)



  git pull ssh://git.haiku-os.org:22/buildtools refs/changes/54/3754/1

diff --git a/gcc/gcc/config/aarch64/aarch64-haiku.h 
b/gcc/gcc/config/aarch64/aarch64-haiku.h
index 1d49930..0322fca 100644
--- a/gcc/gcc/config/aarch64/aarch64-haiku.h
+++ b/gcc/gcc/config/aarch64/aarch64-haiku.h
@@ -22,9 +22,18 @@
 #ifndef GCC_AARCH64_HAIKU_H
 #define GCC_AARCH64_HAIKU_H

-#define HAIKU_DYNAMIC_LINKER           "/system/runtime_loader"
-
-#define CPP_SPEC "%{pthread:-D_REENTRANT}"
+#define TARGET_OS_CPP_BUILTINS()                                               
                                                                                
        \
+  do                                                                           
                                                                                
                                                                                
        \
+    {                                                                          
                                                                                
                                                                                
        \
+      builtin_define ("__HAIKU__");                                            
                                                                                
\
+      builtin_define ("__ARM64__");                                            
                                                                                
\
+      builtin_define ("__arm64__");                                            
                                                                                
\
+      builtin_define ("__stdcall=__attribute__((__stdcall__))");       \
+      builtin_define ("__cdecl=__attribute__((__cdecl__))");                   
\
+      builtin_define ("__STDC_ISO_10646__=201103L");                           
                        \
+      builtin_assert ("system=haiku");                                         
                                                                \
+    }                                                                          
                                                                                
                                                                                
        \
+  while (0)

 #if TARGET_BIG_ENDIAN_DEFAULT
 #define TARGET_LINKER_EMULATION  "aarch64haikub"
@@ -32,23 +41,6 @@
 #define TARGET_LINKER_EMULATION  "aarch64haiku"
 #endif

-#undef  SUBTARGET_EXTRA_LINK_SPEC
-#define SUBTARGET_EXTRA_LINK_SPEC " -m" TARGET_LINKER_EMULATION
-
-#undef  HAIKU_TARGET_LINK_SPEC
-#define HAIKU_TARGET_LINK_SPEC "                                 \
-    %{p:%nconsider using `-pg' instead of `-p' with gprof (1) } \
-    %{v:-V}                                                     \
-    %{assert*} %{R*} %{rpath*} %{defsym*}                       \
-    %{shared:-Bshareable %{h*} %{soname*}}                      \
-    %{symbolic:-Bsymbolic}                                      \
-    %{static:-Bstatic}                                          \
-    %{!static:                                                  \
-      %{rdynamic:-export-dynamic}                               \
-      %{!shared:-dynamic-linker " HAIKU_DYNAMIC_LINKER " }}     \
-    -X" SUBTARGET_EXTRA_LINK_SPEC "                             \
-    %{mbig-endian:-EB} %{mlittle-endian:-EL}"
-
 #if TARGET_FIX_ERR_A53_835769_DEFAULT
 #define CA53_ERR_835769_SPEC \
   " %{!mno-fix-cortex-a53-835769:--fix-cortex-a53-835769}"
@@ -65,20 +57,6 @@
   " %{mfix-cortex-a53-843419:--fix-cortex-a53-843419}"
 #endif

-#define LINK_SPEC HAIKU_TARGET_LINK_SPEC \
-                  CA53_ERR_835769_SPEC \
-                  CA53_ERR_843419_SPEC
-
-#define TARGET_OS_CPP_BUILTINS()               \
-  do                                                                   \
-    {                                                                  \
-       builtin_define ("__HAIKU__");                                   \
-       builtin_define ("__stdcall=__attribute__((__stdcall__))");      \
-       builtin_define ("__cdecl=__attribute__((__cdecl__))");          \
-    builtin_define ("__STDC_ISO_10646__=201103L"); \
-       builtin_assert ("system=haiku");                                        
\
-    }                                                                  \
-  while (0)

 #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
 
@@ -91,4 +69,11 @@
 /* Define this to be nonzero if static stack checking is supported.  */
 #define STACK_CHECK_STATIC_BUILTIN 1

+
+#undef LIBGCC_SPEC
+
+#undef LINK_SPEC
+#define LINK_SPEC "%{!o*:-o %b} -m " TARGET_LINKER_EMULATION " %{!r:-shared} 
%{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}\
+       %{mbig-endian:-EB} %{mlittle-endian:-EL} " CA53_ERR_835769_SPEC " " 
CA53_ERR_843419_SPEC " -X"
+
 #endif  /* GCC_AARCH64_HAIKU_H */

--
To view, visit https://review.haiku-os.org/c/buildtools/+/3754
To unsubscribe, or for help writing mail filters, visit 
https://review.haiku-os.org/settings

Gerrit-Project: buildtools
Gerrit-Branch: master
Gerrit-Change-Id: I80a85502843f82d2324cf816cb761ddfa78e289f
Gerrit-Change-Number: 3754
Gerrit-PatchSet: 1
Gerrit-Owner: Fredrik Holmqvist <fredrik.holmqvist@xxxxxxxxx>
Gerrit-MessageType: newchange

Other related posts:

  • » [haiku-commits] Change in buildtools[master]: WIP Redo gcc AARCH64 config, help wanted - Gerrit