Skip to content

Commit

Permalink
toolchain/libstdcpp: fix multilib flags for SPARC
Browse files Browse the repository at this point in the history
JIRA: RTOS-918
  • Loading branch information
lukileczo committed Sep 12, 2024
1 parent c2453b6 commit 037e76a
Showing 1 changed file with 24 additions and 15 deletions.
39 changes: 24 additions & 15 deletions toolchain/gcc-9.5.0-06-libstdcpp.patch
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ diff -Naur gcc-9.3.0-orig/libstdc++-v3/configure gcc-9.3.0/libstdc++-v3/configur
# Will set LN_S to either 'ln -s', 'ln', or 'cp -p' (if linking isn't
# available). Uncomment the next line to force a particular method.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
@@ -9068,6 +9077,31 @@
@@ -9070,6 +9079,33 @@
lt_prog_compiler_static='-static'

case $host_os in
Expand All @@ -50,8 +50,10 @@ diff -Naur gcc-9.3.0-orig/libstdc++-v3/configure gcc-9.3.0/libstdc++-v3/configur
+ ;;
+
+ sparc)
+
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -fPIC -fPIE -mcpu=leon3 -mno-pic-data-is-text-relative -mpic-register=g6"
+ is_pic=$([[ "$CXX" == *"mno-pic-data-is-text-relative"* ]] && echo "true" || echo "false")
+ if [[ "$is_pic" == "true" ]]; then
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -fPIC -fPIE -mno-pic-data-is-text-relative -mpic-register=g6"
+ fi
+ ;;
+
+ *)
Expand All @@ -63,7 +65,7 @@ diff -Naur gcc-9.3.0-orig/libstdc++-v3/configure gcc-9.3.0/libstdc++-v3/configur
aix*)
# All AIX code is PIC.
if test "$host_cpu" = ia64; then
@@ -9342,6 +9376,33 @@
@@ -9344,6 +9380,36 @@
*djgpp*)
lt_prog_compiler_pic=
;;
Expand All @@ -84,7 +86,10 @@ diff -Naur gcc-9.3.0-orig/libstdc++-v3/configure gcc-9.3.0/libstdc++-v3/configur
+ ;;
+
+ sparc)
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+ is_pic=$([[ "$CXX" == *"mno-pic-data-is-text-relative"* ]] && echo "true" || echo "false")
+ if [[ "$is_pic" == "true" ]]; then
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+ fi
+ ;;
+
+ # For other targets the behaviour should be default
Expand All @@ -97,7 +102,7 @@ diff -Naur gcc-9.3.0-orig/libstdc++-v3/configure gcc-9.3.0/libstdc++-v3/configur
*)
lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
;;
@@ -11755,6 +11816,9 @@
@@ -11757,6 +11823,9 @@
lt_cv_dlopen_libs=

case $host_os in
Expand All @@ -107,7 +112,7 @@ diff -Naur gcc-9.3.0-orig/libstdc++-v3/configure gcc-9.3.0/libstdc++-v3/configur
beos*)
lt_cv_dlopen="load_add_on"
lt_cv_dlopen_libs=
@@ -13951,6 +14015,32 @@
@@ -13953,6 +14022,34 @@
lt_prog_compiler_static_CXX='-static'

case $host_os in
Expand All @@ -127,8 +132,10 @@ diff -Naur gcc-9.3.0-orig/libstdc++-v3/configure gcc-9.3.0/libstdc++-v3/configur
+ ;;
+
+ sparc)
+
+ lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -fPIC -fPIE -mcpu=leon3 -mno-pic-data-is-text-relative -mpic-register=g6"
+ is_pic=$([[ "$CXX" == *"mno-pic-data-is-text-relative"* ]] && echo "true" || echo "false")
+ if [[ "$is_pic" == "true" ]]; then
+ lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -fPIC -fPIE -mno-pic-data-is-text-relative -mpic-register=g6"
+ fi
+ ;;
+
+ *)
Expand All @@ -140,7 +147,7 @@ diff -Naur gcc-9.3.0-orig/libstdc++-v3/configure gcc-9.3.0/libstdc++-v3/configur
aix*)
# All AIX code is PIC.
if test "$host_cpu" = ia64; then
@@ -14261,6 +14351,34 @@
@@ -14263,6 +14360,36 @@
*djgpp*)
lt_prog_compiler_pic_CXX=
;;
Expand All @@ -161,8 +168,10 @@ diff -Naur gcc-9.3.0-orig/libstdc++-v3/configure gcc-9.3.0/libstdc++-v3/configur
+ ;;
+
+ sparc)
+
+ lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+ is_pic=$([[ "$CXX" == *"mno-pic-data-is-text-relative"* ]] && echo "true" || echo "false")
+ if [[ "$is_pic" == "true" ]]; then
+ lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+ fi
+ ;;
+
+ # For other arm targets the behaviour should be default
Expand All @@ -175,7 +184,7 @@ diff -Naur gcc-9.3.0-orig/libstdc++-v3/configure gcc-9.3.0/libstdc++-v3/configur
*)
lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
;;
@@ -15464,6 +15582,13 @@
@@ -15466,6 +15593,13 @@
glibcxx_compiler_pic_flag="$lt_prog_compiler_pic_CXX"
glibcxx_compiler_shared_flag="-D_GLIBCXX_SHARED"

Expand All @@ -189,7 +198,7 @@ diff -Naur gcc-9.3.0-orig/libstdc++-v3/configure gcc-9.3.0/libstdc++-v3/configur
else
glibcxx_lt_pic_flag=
glibcxx_compiler_pic_flag=
@@ -29477,7 +29602,7 @@
@@ -28848,7 +28982,7 @@
# Construct crosses by hand, eliminating bits that need ld...
# GLIBCXX_CHECK_MATH_SUPPORT

Expand All @@ -198,7 +207,7 @@ diff -Naur gcc-9.3.0-orig/libstdc++-v3/configure gcc-9.3.0/libstdc++-v3/configur
# on a hosted environment.
if test "x${with_newlib}" = "xyes"; then
os_include_dir="os/newlib"
@@ -29537,6 +29662,61 @@
@@ -28908,6 +29042,61 @@

$as_echo "#define HAVE_MEMALIGN 1" >>confdefs.h

Expand Down

0 comments on commit 037e76a

Please sign in to comment.