mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] mcm native compile and llvm.
@ 2023-03-20  0:46 Rob Landley
  2023-03-20  4:05 ` Jeffrey Walton
  0 siblings, 1 reply; 2+ messages in thread
From: Rob Landley @ 2023-03-20  0:46 UTC (permalink / raw)
  To: Rich Felker, musl

[-- Attachment #1: Type: text/plain, Size: 2048 bytes --]

1) In case you missed the #musl irc backscroll, building current mcm tip of tree
works but building native compilers with the results fails unless you add
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80196#c13 to patches/gcc-11.2.0
list, which is the exact same fix they applied upstream:

https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=4fde88e5dd152fe866a97b12e0f8229970d15cb3

So it's basically a backport. Attached is the one I used, which Worked For Me.

(P.S. Apparently gcc 11.2.0 build breaks configuring libstdc++ on a machine that
hasn't got floating point support, so even the _cross_ armv7r toolchain doesn't
build anymore. Possibly I need to beat soft float out of it in the config
somewhere? Oh well...)

2) I have an old blog entry: https://landley.net/notes-2021.html#28-07-2021

Where I was building clang/llvm compilers, which resulted in this patch against
musl (ported to current git):

diff --git a/configure b/configure
index 853bf05e..61471d61 100755
--- a/configure
+++ b/configure
@@ -321,8 +321,8 @@ printf "%s\n" "$target"
 #
 case "$target" in
 # Catch these early to simplify matching for 32-bit archs
-arm*) ARCH=arm ;;
-aarch64*) ARCH=aarch64 ;;
+thumb*|arm*) ARCH=arm ;;
+arm64*|aarch64*) ARCH=aarch64 ;;
 i?86-nt32*) ARCH=nt32 ;;
 i?86*) ARCH=i386 ;;
 x86_64-x32*|x32*|x86_64*x32) ARCH=x32 ;;
@@ -337,7 +337,7 @@ powerpc64*|ppc64*) ARCH=powerpc64 ;;
 powerpc*|ppc*) ARCH=powerpc ;;
 riscv64*) ARCH=riscv64 ;;
 sh[1-9bel-]*|sh|superh*) ARCH=sh ;;
-s390x*) ARCH=s390x ;;
+s390x*|systemz*) ARCH=s390x ;;
 unknown) fail "$0: unable to detect target arch; try $0 --target=..." ;;
 *) fail "$0: unknown or unsupported target \"$target\"" ;;
 esac

Because llvm uses different tuple names from the gnu/dammit stuff and it might
be nice to support both? (Is anybody else out there building musl clang
toolchains? I fished a hexagon build out of qemu's test infrastructure, and I
got pointed at google fuchsia doing x86 and arm, but that's 3 architectures
total and the hexagon build broke when I pulled a newer llvm...)

Rob

[-- Attachment #2: 0006-native.diff --]
[-- Type: text/x-patch, Size: 871 bytes --]

--- gcc-11.2.0.orig/configure	2021-07-28 01:55:06.628278148 -0500
+++ gcc-11.2.0/configure	2023-03-17 00:15:10.855899259 -0500
@@ -16478,7 +16478,7 @@
 fi
 
 
-RAW_CXX_FOR_TARGET="$CXX_FOR_TARGET"
+RAW_CXX_FOR_TARGET="$CXX_FOR_TARGET -nostdinc++"
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target ar" >&5
 $as_echo_n "checking where to find the target ar... " >&6; }
--- gcc-11.2.0.orig/configure.ac	2021-07-28 01:55:06.628278148 -0500
+++ gcc-11.2.0/configure.ac	2023-03-17 00:15:32.831898842 -0500
@@ -3520,7 +3520,7 @@
 ACX_CHECK_INSTALLED_TARGET_TOOL(WINDRES_FOR_TARGET, windres)
 ACX_CHECK_INSTALLED_TARGET_TOOL(WINDMC_FOR_TARGET, windmc)
 
-RAW_CXX_FOR_TARGET="$CXX_FOR_TARGET"
+RAW_CXX_FOR_TARGET="$CXX_FOR_TARGET -nostdinc"
 
 GCC_TARGET_TOOL(ar, AR_FOR_TARGET, AR, [binutils/ar])
 GCC_TARGET_TOOL(as, AS_FOR_TARGET, AS, [gas/as-new])

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [musl] mcm native compile and llvm.
  2023-03-20  0:46 [musl] mcm native compile and llvm Rob Landley
@ 2023-03-20  4:05 ` Jeffrey Walton
  0 siblings, 0 replies; 2+ messages in thread
From: Jeffrey Walton @ 2023-03-20  4:05 UTC (permalink / raw)
  To: musl; +Cc: Rich Felker

On Sun, Mar 19, 2023 at 8:32 PM Rob Landley <rob@landley.net> wrote:
>
> 1) In case you missed the #musl irc backscroll, building current mcm tip of tree
> works but building native compilers with the results fails unless you add
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80196#c13 to patches/gcc-11.2.0
> list, which is the exact same fix they applied upstream:
>
> https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=4fde88e5dd152fe866a97b12e0f8229970d15cb3
>
> So it's basically a backport. Attached is the one I used, which Worked For Me.
>
> (P.S. Apparently gcc 11.2.0 build breaks configuring libstdc++ on a machine that
> hasn't got floating point support, so even the _cross_ armv7r toolchain doesn't
> build anymore. Possibly I need to beat soft float out of it in the config
> somewhere? Oh well...)
>
> 2) I have an old blog entry: https://landley.net/notes-2021.html#28-07-2021
>
> Where I was building clang/llvm compilers, which resulted in this patch against
> musl (ported to current git):
>
> diff --git a/configure b/configure
> index 853bf05e..61471d61 100755
> --- a/configure
> +++ b/configure
> @@ -321,8 +321,8 @@ printf "%s\n" "$target"
>  #
>  case "$target" in
>  # Catch these early to simplify matching for 32-bit archs
> -arm*) ARCH=arm ;;
> -aarch64*) ARCH=aarch64 ;;
> +thumb*|arm*) ARCH=arm ;;
> +arm64*|aarch64*) ARCH=aarch64 ;;
>  i?86-nt32*) ARCH=nt32 ;;
>  i?86*) ARCH=i386 ;;
>  x86_64-x32*|x32*|x86_64*x32) ARCH=x32 ;;
> @@ -337,7 +337,7 @@ powerpc64*|ppc64*) ARCH=powerpc64 ;;
>  powerpc*|ppc*) ARCH=powerpc ;;
>  riscv64*) ARCH=riscv64 ;;
>  sh[1-9bel-]*|sh|superh*) ARCH=sh ;;
> -s390x*) ARCH=s390x ;;
> +s390x*|systemz*) ARCH=s390x ;;
>  unknown) fail "$0: unable to detect target arch; try $0 --target=..." ;;
>  *) fail "$0: unknown or unsupported target \"$target\"" ;;
>  esac
>
> Because llvm uses different tuple names from the gnu/dammit stuff and it might
> be nice to support both? (Is anybody else out there building musl clang
> toolchains? I fished a hexagon build out of qemu's test infrastructure, and I
> got pointed at google fuchsia doing x86 and arm, but that's 3 architectures
> total and the hexagon build broke when I pulled a newer llvm...)

Maybe

   -arm*) ARCH=arm ;;
   -aarch64*) ARCH=aarch64 ;;
   +arm64*|aarch64*) ARCH=aarch64 ;;
   +thumb*|arm*) ARCH=arm ;;

To ensure 'arm64' does not match 'arm*'.

Jeff

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-20  4:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-20  0:46 [musl] mcm native compile and llvm Rob Landley
2023-03-20  4:05 ` Jeffrey Walton

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).