powerpc/powerpc64: Support build with musl as libc
cover powerpc/powerpc64: Support build with musl as libc
Musl has support for ppc (32bit) and ppc64 (64bit). OE still missing several tricks in configuration to make builds possible:
1) Most important part is that musl implements elfv2 ABI only for 64bit PowerPC. That ABI is default for little-endian but supports big-endian too. Historically elfv1 ABI is used for big-endian PowerPC.
2) Using uncommon elfv2 ABI for big-endian requires to disable all assembler optimizations in openssl: unfortunately I can't find more smart way at the moment.
3) LDSO path need to be adjusted to support /lib64 path which is default for powerpc64 (see bitbake.conf) instead of $baselibdir.
4) Default library search path is hardcoded to "/lib:/usr/local/lib:/usr/lib": pass -DSYSLIBDIR and -DLIBDIR and use them to set path.
5) Need to add more tweaks to patch that adds --with-ldbl-128 knob to gcc configure: there is a set of functions that use TFtype in ppc64-fp.c in libgcc. This should be compatible with glibc.
6) Disable qemu-userspace for powerpc64 bit: there is no support. While there change qemuwrapper to exit explicitly to fix infinite execution in do_rootfs() task when building on IBM POWER8 machine.
7) Misc fixes that map powerpc-linux-musl python3 triplet to powerpc-linux-gnu, remove conflicting sed in do_configure() vs patch settings in gcc and fix DEFAULTTUNE settings for various IBM POWER platforms.
Build is done on IBM POWER8 machine running RHEL7:
Images:
-------
core-image-sato
core-image-full-cmdline
For powerpc64:
--------------
glibc musl
systemd sysvinit systemd sysvinit
gcc-7.3 y y y y gcc-8.2 y y y y
For powerpc:
------------
glibc musl
systemd sysvinit systemd sysvinit
gcc-7.3 n x x x (*) gcc-8.2 y y y y
Note that gcc-7.3 builds for 32bit powerpc fail due to:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=11754
Kernel/images are boot tested using KVM-HV on IBM POWER8.
Serhey Popovych (13):
lib/oe/elf.py: Add powerpc64 architecture definition for musl tune-power[5-7].inc: Fix DEFAULTTUNE values tune-power[5-7].inc: Disable QEMU usermode usage
qemuwrapper: Explicitly exit in case of no qemu supported for target arch-powerpc64.inc: Use elfv2 ABI when building with musl
musl: Create default library search path based on configuration
musl: Ensure GLIBC_LDSO symlink target does not exist on reinstall
openssl: Skip assembler optimized code for powerpc64 with musl
python3: Fix do_configure check platform triplet error (2)
gcc: Fix preprocessor redefines for header pathes
gcc: More places to patch to disable ldbl 128 for musl on PPC
gcc: Enable secureplt for powerpc64 target too gcc-7.3,gcc-8.2: Use variable SYSTEMLIBS_DIR instead of hardcoding it
for ppc64
.../machine/include/powerpc/arch-powerpc64.inc | 3 + meta/conf/machine/include/tune-power5.inc | 5 +- meta/conf/machine/include/tune-power6.inc | 5 +- meta/conf/machine/include/tune-power7.inc | 5 +- meta/lib/oe/elf.py | 1 + .../openssl/openssl10_1.0.2q.bb | 1 + .../recipes-connectivity/openssl/openssl_1.1.1a.bb | 1 + ...slibdir-and-libdir-as-default-pathes-to-l.patch | 61 ++++ meta/recipes-core/musl/musl_git.bb | 3 +- meta/recipes-devtools/gcc/gcc-7.3.inc | 1 + ...Ensure-target-gcc-headers-can-be-included.patch | 36 -- ...44-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch | 391 ++++++++++++++++++++- ...werpc-powerpc64-Add-support-for-musl-ldso.patch | 31 ++ meta/recipes-devtools/gcc/gcc-8.2.inc | 1 + ...Ensure-target-gcc-headers-can-be-included.patch | 36 -- ...34-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch | 342 +++++++++++++++++- ...werpc-powerpc64-Add-support-for-musl-ldso.patch | 31 ++ meta/recipes-devtools/gcc/gcc-common.inc | 2 +- .../tweak-MULTIARCH-for-powerpc-linux-musl.patch | 40 +++ meta/recipes-devtools/python/python3_3.5.6.bb | 1 + .../recipes-devtools/qemu/qemuwrapper-cross_1.0.bb | 3 +- 21 files changed, 920 insertions(+), 80 deletions(-) create mode 100644 meta/recipes-core/musl/musl/0002-ldso-Use-syslibdir-and-libdir-as-default-pathes-to-l.patch create mode 100644 meta/recipes-devtools/gcc/gcc-7.3/0050-powerpc-powerpc64-Add-support-for-musl-ldso.patch create mode 100644 meta/recipes-devtools/gcc/gcc-8.2/0042-powerpc-powerpc64-Add-support-for-musl-ldso.patch create mode 100644 meta/recipes-devtools/python/python3/tweak-MULTIARCH-for-powerpc-linux-musl.patch
Signature · 1 line
2.7.4
PATCH 1/13 lib/oe/elf.py: Add powerpc64 architecture definition for musl
Add the ELF definition for the powerpc64 architecture when building with musl as libc.
--- meta/lib/oe/elf.py | 1 + 1 file changed, 1 insertion(+)
meta/lib/oe/elf.py +1 -0
@@ -63,6 +63,7 @@ def machine_dict(d): "arm" : ( 40, 97, 0, True, 32), "armeb": ( 40, 97, 0, False, 32), "powerpc": ( 20, 0, 0, False, 32), + "powerpc64": ( 21, 0, 0, False, 64), "i386": ( 3, 0, 0, True, 32), "i486": ( 3, 0, 0, True, 32), "i586": ( 3, 0, 0, True, 32),
Signature · 1 line
2.7.4
PATCH 2/13 tune-power[5-7].inc: Fix DEFAULTTUNE values
In reply to Serhey PopovychIt is ppcpX, not ppcprX, where X is 6 or 7. While there select 32bit tune for P5 machine to bring it inline with P6 and P7.
--- meta/conf/machine/include/tune-power5.inc | 2 +- meta/conf/machine/include/tune-power6.inc | 2 +- meta/conf/machine/include/tune-power7.inc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
meta/conf/machine/include/tune-power5.inc +1 -1
@@ -1,4 +1,4 @@ -DEFAULTTUNE ?= "ppc64p5" +DEFAULTTUNE ?= "ppcp5" require conf/machine/include/powerpc/arch-powerpc64.inc
meta/conf/machine/include/tune-power6.inc +1 -1
@@ -1,4 +1,4 @@ -DEFAULTTUNE ?= "ppcpr6" +DEFAULTTUNE ?= "ppcp6" require conf/machine/include/powerpc/arch-powerpc64.inc
meta/conf/machine/include/tune-power7.inc +1 -1
@@ -1,4 +1,4 @@ -DEFAULTTUNE ?= "ppcpr7" +DEFAULTTUNE ?= "ppcp7" require conf/machine/include/powerpc/arch-powerpc64.inc
Signature · 1 line
2.7.4
PATCH 3/13 tune-power[5-7].inc: Disable QEMU usermode usage
In reply to Serhey PopovychThe QEMU usermode fails with invalid instruction error when used with those tunes.
--- meta/conf/machine/include/tune-power5.inc | 3 +++ meta/conf/machine/include/tune-power6.inc | 3 +++ meta/conf/machine/include/tune-power7.inc | 3 +++ 3 files changed, 9 insertions(+)
meta/conf/machine/include/tune-power5.inc +3 -0
@@ -19,3 +19,6 @@ PACKAGE_EXTRA_ARCHS_tune-ppc64p5 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc64} ppc64p # glibc configure options to get power5 specific library GLIBC_EXTRA_OECONF_powerpc64 += "${@bb.utils.contains('TUNE_FEATURES', 'power5', '--with-cpu=power5', '', d)}" GLIBC_EXTRA_OECONF_powerpc += "${@bb.utils.contains('TUNE_FEATURES', 'power5', '--with-cpu=power5', '', d)}" + +# QEMU usermode fails with invalid instruction error +MACHINE_FEATURES_BACKFILL_CONSIDERED_append = "${@bb.utils.contains('TUNE_FEATURES', 'power5', ' qemu-usermode', '', d)}"
meta/conf/machine/include/tune-power6.inc +3 -0
@@ -19,3 +19,6 @@ PACKAGE_EXTRA_ARCHS_tune-ppc64p6 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc64} ppc64p # glibc configure options to get power6 specific library GLIBC_EXTRA_OECONF_powerpc64 += "${@bb.utils.contains('TUNE_FEATURES', 'power6', '--with-cpu=power6', '', d)}" GLIBC_EXTRA_OECONF_powerpc += "${@bb.utils.contains('TUNE_FEATURES', 'power6', '--with-cpu=power6', '', d)}" + +# QEMU usermode fails with invalid instruction error +MACHINE_FEATURES_BACKFILL_CONSIDERED_append = "${@bb.utils.contains('TUNE_FEATURES', 'power6', ' qemu-usermode', '', d)}"
meta/conf/machine/include/tune-power7.inc +3 -0
@@ -19,3 +19,6 @@ PACKAGE_EXTRA_ARCHS_tune-ppc64p7 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc64} ppc64p # glibc configure options to get power7 specific library GLIBC_EXTRA_OECONF_powerpc64 += "${@bb.utils.contains('TUNE_FEATURES', 'power7', '--with-cpu=power7', '', d)}" GLIBC_EXTRA_OECONF_powerpc += "${@bb.utils.contains('TUNE_FEATURES', 'power7', '--with-cpu=power7', '', d)}" + +# QEMU usermode fails with invalid instruction error +MACHINE_FEATURES_BACKFILL_CONSIDERED_append = "${@bb.utils.contains('TUNE_FEATURES', 'power7', ' qemu-usermode', '', d)}"
Signature · 1 line
2.7.4
PATCH 4/13 qemuwrapper: Explicitly exit in case of no qemu supported for target
In reply to Serhey PopovychRunning qemu for userspace code on unsupported target binaries might be bad idea because qemu could say running in endless loop instead of crashing due to illegal instruction or unsupported binary format.
While this is qemu bug we should avoid hitting it by explicitly exiting from the wrapper when qemu backfill considered for machine.
Behaviour was observed in do_rootfs stage when building on IBM Power 8 host for PowerPC e7400 target.
--- meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb +2 -1
@@ -21,7 +21,8 @@ do_install () { set -x if [ ${@bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'True', 'False', d)} = False ]; then - echo "qemuwrapper: qemu usermode is not supported" + echo "qemuwrapper: qemu usermode is not supported" + exit 1 fi
Signature · 1 line
2.7.4
PATCH 5/13 arch-powerpc64.inc: Use elfv2 ABI when building with musl
In reply to Serhey PopovychHistorically first PowerPC ABI was big-endian only (elfv1 currently). It is standard ABI for both 32-bit ppc and 64-bit ppc64 architectures.
With PowerPC little-endian support new ABI was introduced (elfv2) and it is used primarily with ppc64le target only. While it has support for big-endian it is not commonly used and elfv1 still preferred.
Musl does support only elfv2 ABI for both LE and BE and does not have any plans to support elfv1.
Since then to build for powerpc64 with musl new ABI should be used. As expected it is not compatible with elfv1 but that isn't problem as long as there is no binary distributed software or assembly code written for elfv1 ABI.
--- meta/conf/machine/include/powerpc/arch-powerpc64.inc | 3 +++ 1 file changed, 3 insertions(+)
meta/conf/machine/include/powerpc/arch-powerpc64.inc +3 -0
@@ -7,6 +7,9 @@ TUNECONFLICTS[m64] = "m32 nf" TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'm64', ' -m64', '', d)}" TUNE_ARCH .= "${@bb.utils.contains('TUNE_FEATURES', [ 'm64' ], 'powerpc64', '', d)}" +# musl only supports elfv2 ABI for ppc64 +TUNE_CCARGS .= "${@['', ' -mabi=elfv2']['libc-musl' in d.getVar('OVERRIDES').split(':')]}" + # user mode qemu doesn't support ppc64 MACHINE_FEATURES_BACKFILL_CONSIDERED_append = " ${@bb.utils.contains('TUNE_FEATURES', 'm64', 'qemu-usermode', '', d)}"
Signature · 1 line
2.7.4
Re: [PATCH 05/13] arch-powerpc64.inc: Use elfv2 ABI when building with musl
Quoted 26 lines · Serhey Popovych
Historically first PowerPC ABI was big-endian only (elfv1 currently). It is standard ABI for both 32-bit ppc and 64-bit ppc64 architectures.
With PowerPC little-endian support new ABI was introduced (elfv2) and it is used primarily with ppc64le target only. While it has support for big-endian it is not commonly used and elfv1 still preferred.
Musl does support only elfv2 ABI for both LE and BE and does not have any plans to support elfv1.
Since then to build for powerpc64 with musl new ABI should be used. As expected it is not compatible with elfv1 but that isn't problem as long as there is no binary distributed software or assembly code written for elfv1 ABI.
Signed-off-by Serhey Popovych <[email protected]>--- meta/conf/machine/include/powerpc/arch-powerpc64.inc | 3 +++ 1 file changed, 3 insertions(+)meta/conf/machine/include/powerpc/arch-powerpc64.inc +0
-0
meta/conf/machine/include/powerpc/arch-powerpc64.inc TUNECONFLICTS[m64] = "m32 nf" · line 12
Quoted 6 lines
meta/conf/machine/include/powerpc/arch-powerpc64.inc +3
-0@@ -7,6 +7,9 @@ TUNECONFLICTS[m64] = "m32 nf" TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'm64', ' -m64', '', d)}" TUNE_ARCH .= "${@bb.utils.contains('TUNE_FEATURES', [ 'm64' ], 'powerpc64', '', d)}" +# musl only supports elfv2 ABI for ppc64 +TUNE_CCARGS .= "${@['', ' -mabi=elfv2']['libc-musl' in d.getVar('OVERRIDES').split(':')]}" +
I wonder if we should change gcc to use this ABI by default when configured for ppc64/musl ?
This would avoid us adding compiler options here, in bad cases it may be that other compilers
call it out differently.
Quoted 11 lines
meta/conf/machine/include/powerpc/arch-powerpc64.inc +0
-1# user mode qemu doesn't support ppc64 MACHINE_FEATURES_BACKFILL_CONSIDERED_append = " ${@bb.utils.contains('TUNE_FEATURES', 'm64', 'qemu-usermode', '', d)}" --2.7.4
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [PATCH 05/13] arch-powerpc64.inc: Use elfv2 ABI when building with musl
Quoted 31 lines · Khem Raj
Quoted 29 lines · Serhey Popovych
Historically first PowerPC ABI was big-endian only (elfv1 currently). It is standard ABI for both 32-bit ppc and 64-bit ppc64 architectures.
With PowerPC little-endian support new ABI was introduced (elfv2) and it is used primarily with ppc64le target only. While it has support for big-endian it is not commonly used and elfv1 still preferred.
Musl does support only elfv2 ABI for both LE and BE and does not have any plans to support elfv1.
Since then to build for powerpc64 with musl new ABI should be used. As expected it is not compatible with elfv1 but that isn't problem as long as there is no binary distributed software or assembly code written for elfv1 ABI.
Signed-off-by Serhey Popovych <[email protected]>--- meta/conf/machine/include/powerpc/arch-powerpc64.inc | 3 +++ 1 file changed, 3 insertions(+)meta/conf/machine/include/powerpc/arch-powerpc64.inc +0
-0@@ -7,6 +7,9 @@ TUNECONFLICTS[m64] = "m32 nf" TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'm64', ' -m64', '', d)}" TUNE_ARCH .= "${@bb.utils.contains('TUNE_FEATURES', [ 'm64' ], 'powerpc64', '', d)}"
Quoted 9 lines
meta/conf/machine/include/powerpc/arch-powerpc64.inc TUNECONFLICTS[m64] = "m32 nf" · line 12
Quoted 3 lines
meta/conf/machine/include/powerpc/arch-powerpc64.inc +3
-0+# musl only supports elfv2 ABI for ppc64 +TUNE_CCARGS .= "${@['', ' -mabi=elfv2']['libc-musl' in d.getVar('OVERRIDES').split(':')]}" +I wonder if we should change gcc to use this ABI by default when configured for ppc64/musl ?
This would avoid us adding compiler options here, in bad cases it may be that other compilers
call it out differently.
Good point. This should be easy to do with patch applied for libc-musl override.
Quoted 12 lines
Quoted 12 lines
meta/conf/machine/include/powerpc/arch-powerpc64.inc +0
-1# user mode qemu doesn't support ppc64 MACHINE_FEATURES_BACKFILL_CONSIDERED_append = " ${@bb.utils.contains('TUNE_FEATURES', 'm64', 'qemu-usermode', '', d)}" --2.7.4
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [PATCH 05/13] arch-powerpc64.inc: Use elfv2 ABI when building with musl
Quoted 54 lines · Serhey Popovych
Quoted 41 lines · Khem Raj
Quoted 39 lines · Serhey Popovych
Historically first PowerPC ABI was big-endian only (elfv1 currently). It
is standard ABI for both 32-bit ppc and 64-bit ppc64 architectures.With PowerPC little-endian support new ABI was introduced (elfv2) and it
is used primarily with ppc64le target only. While it has support for
big-endian it is not commonly used and elfv1 still preferred.Musl does support only elfv2 ABI for both LE and BE and does not have
any plans to support elfv1.Since then to build for powerpc64 with musl new ABI should be used. As
expected it is not compatible with elfv1 but that isn't problem as long
as there is no binary distributed software or assembly code written for
elfv1 ABI.Signed-off-by Serhey Popovych <[email protected]>--- meta/conf/machine/include/powerpc/arch-powerpc64.inc | 3 +++ 1 file changed, 3 insertions(+)meta/conf/machine/include/powerpc/arch-powerpc64.inc +0
-1@@ -7,6 +7,9 @@ TUNECONFLICTS[m64] = "m32 nf" TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'm64', ' -m64', '', d)}" TUNE_ARCH .= "${@bb.utils.contains('TUNE_FEATURES', [ 'm64' ],'powerpc64', '', d)}"
Quoted 11 lines
Quoted 4 lines
meta/conf/machine/include/powerpc/arch-powerpc64.inc +2
-0+# musl only supports elfv2 ABI for ppc64 +TUNE_CCARGS .= "${@['', ' -mabi=elfv2']['libc-musl' ind.getVar('OVERRIDES').split(':')]}"
+I wonder if we should change gcc to use this ABI by default when configured for ppc64/musl ?
This would avoid us adding compiler options here, in bad cases it may
be that other compilers
call it out differently.
Quoted 3 lines
Good point. This should be easy to do with patch applied for libc- musl
override.
Given our gcc shared-workdir which is shared between musl and non-musl builds, I'm not sure this will be quite that easy. It would need to be build configuration time rather than source patching...
Cheers,
Richard
PATCH 6/13 musl: Create default library search path based on configuration
In reply to Serhey PopovychIn absence of /etc/ld-musl-$(ARCH).path file musl uses hardcoded default search path "/lib:/usr/local/lib:/usr/lib". This works for cases when system libraries installed in one of these pathes.
However if lib64 or libx32 used as system library directories and no usr merge functionality enabled for distro musl dynamic loader cannot find libraries and finally execute binaries.
Found while working on support for musl on powerpc64 builds where lib64 variant is used regardless of multilib being on or off.
Fix by creating default search path based on configuration time values for syslibdir and libdir.
--- ...slibdir-and-libdir-as-default-pathes-to-l.patch | 61 ++++++++++++++++++++++ meta/recipes-core/musl/musl_git.bb | 1 + 2 files changed, 62 insertions(+) create mode 100644 meta/recipes-core/musl/musl/0002-ldso-Use-syslibdir-and-libdir-as-default-pathes-to-l.patch
meta/recipes-core/musl/musl/0002-ldso-Use-syslibdir-and-libdir-as-default-pathes-to-l.patch new file +61 -0
@@ -0,0 +1,61 @@ +From 5a2886f81dbca3f2ed28eebe7d27d471da278db8 Mon Sep 17 00:00:00 2001 +From: Serhey Popovych <[email protected]> +Date: Tue, 11 Dec 2018 05:44:20 -0500 +Subject: [PATCH] ldso: Use syslibdir and libdir as default pathes to libdirs + +In absence of /etc/ld-musl-$(ARCH).path ldso uses default path to search +libraries /lib:/usr/local/lib:/usr/lib. + +However this path isn't relevant in case when library is put in dirs +like lib64 or libx32. + +Adjust CFLAGS_ALL to pass syslibdir as SYSLIBDIR and libdir as LIBDIR +preprocessor macroses to construct default ldso library search path +in ldso/dynlink.c::SYS_PATH_DFLT. + +Upstream-Status: Pending +Signed-off-by: Serhey Popovych <[email protected]> +--- + Makefile | 3 ++- + ldso/dynlink.c | 4 +++- + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index b46f8ca4..c07e4ae8 100644 +--- a/Makefile ++++ b/Makefile +@@ -46,7 +46,8 @@ CFLAGS_AUTO = -Os -pipe + CFLAGS_C99FSE = -std=c99 -ffreestanding -nostdinc + + CFLAGS_ALL = $(CFLAGS_C99FSE) +-CFLAGS_ALL += -D_XOPEN_SOURCE=700 -I$(srcdir)/arch/$(ARCH) -I$(srcdir)/arch/generic -Iobj/src/internal -I$(srcdir)/src/include -I$(srcdir)/src/internal -Iobj/include -I$(srcdir)/include ++CFLAGS_ALL += -D_XOPEN_SOURCE=700 -DSYSLIBDIR='"$(syslibdir)"' -DLIBDIR='"$(libdir)"' ++CFLAGS_ALL += -I$(srcdir)/arch/$(ARCH) -I$(srcdir)/arch/generic -Iobj/src/internal -I$(srcdir)/src/include -I$(srcdir)/src/internal -Iobj/include -I$(srcdir)/include + CFLAGS_ALL += $(CPPFLAGS) $(CFLAGS_AUTO) $(CFLAGS) + + LDFLAGS_ALL = $(LDFLAGS_AUTO) $(LDFLAGS) +diff --git a/ldso/dynlink.c b/ldso/dynlink.c +index ec921dfd..7c119c55 100644 +--- a/ldso/dynlink.c ++++ b/ldso/dynlink.c +@@ -22,6 +22,8 @@ + #include "dynlink.h" + #include "malloc_impl.h" + ++#define SYS_PATH_DFLT SYSLIBDIR ":" LIBDIR ++ + static void error(const char *, ...); + + #define MAXP2(a,b) (-(-(a)&-(b))) +@@ -1038,7 +1040,7 @@ static struct dso *load_library(const char *name, struct dso *needed_by) + sys_path = ""; + } + } +- if (!sys_path) sys_path = "/lib:/usr/local/lib:/usr/lib"; ++ if (!sys_path) sys_path = SYS_PATH_DFLT; + fd = path_open(name, sys_path, buf, sizeof buf); + } + pathname = buf; +-- +2.7.4 +
meta/recipes-core/musl/musl_git.bb +1 -0
@@ -12,6 +12,7 @@ PV = "1.1.20+git${SRCPV}" SRC_URI = "git://git.musl-libc.org/musl \ file://0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch \ + file://0002-ldso-Use-syslibdir-and-libdir-as-default-pathes-to-l.patch \ " S = "${WORKDIR}/git"
Signature · 1 line
2.7.4
Re: [PATCH 06/13] musl: Create default library search path based on configuration
Quoted 9 lines · Serhey Popovych
In absence of /etc/ld-musl-$(ARCH).path file musl uses hardcoded default search path "/lib:/usr/local/lib:/usr/lib". This works for cases when system libraries installed in one of these pathes.
However if lib64 or libx32 used as system library directories and no usr merge functionality enabled for distro musl dynamic loader cannot find libraries and finally execute binaries.
Quoted 5 lines
Found while working on support for musl on powerpc64 builds where lib64 variant is used regardless of multilib being on or off.
Fix by creating default search path based on configuration time values for syslibdir and libdir.
Lets take this fix to musl upstream at the same time. I think it does have some value
but if upstream does not agree then we are in for supporting this forever, and I would like
us to have upstream review on it first.
Quoted 95 lines
Signed-off-by Serhey Popovych <[email protected]>--- ...slibdir-and-libdir-as-default-pathes-to-l.patch | 61 ++++++++++++++++++++++ meta/recipes-core/musl/musl_git.bb | 1 + 2 files changed, 62 insertions(+) create mode 100644 meta/recipes-core/musl/musl/0002-ldso-Use-syslibdir-and-libdir-as-default-pathes-to-l.patchmeta/recipes-core/musl/musl/0002-ldso-Use-syslibdir-and-libdir-as-default-pathes-to-l.patch new file +61
-0@@ -0,0 +1,61 @@ +From 5a2886f81dbca3f2ed28eebe7d27d471da278db8 Mon Sep 17 00:00:00 2001 +From: Serhey Popovych <[email protected]> +Date: Tue, 11 Dec 2018 05:44:20 -0500 +Subject: [PATCH] ldso: Use syslibdir and libdir as default pathes to libdirs + +In absence of /etc/ld-musl-$(ARCH).path ldso uses default path to search +libraries /lib:/usr/local/lib:/usr/lib. + +However this path isn't relevant in case when library is put in dirs +like lib64 or libx32. + +Adjust CFLAGS_ALL to pass syslibdir as SYSLIBDIR and libdir as LIBDIR +preprocessor macroses to construct default ldso library search path +in ldso/dynlink.c::SYS_PATH_DFLT. + +Upstream-Status: Pending +Signed-off-by: Serhey Popovych <[email protected]> +--- + Makefile | 3 ++- + ldso/dynlink.c | 4 +++- + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index b46f8ca4..c07e4ae8 100644 +--- a/Makefile ++++ b/Makefile +@@ -46,7 +46,8 @@ CFLAGS_AUTO = -Os -pipe + CFLAGS_C99FSE = -std=c99 -ffreestanding -nostdinc + + CFLAGS_ALL = $(CFLAGS_C99FSE) +-CFLAGS_ALL += -D_XOPEN_SOURCE=700 -I$(srcdir)/arch/$(ARCH) -I$(srcdir)/arch/generic -Iobj/src/internal -I$(srcdir)/src/include -I$(srcdir)/src/internal -Iobj/include -I$(srcdir)/include ++CFLAGS_ALL += -D_XOPEN_SOURCE=700 -DSYSLIBDIR='"$(syslibdir)"' -DLIBDIR='"$(libdir)"' ++CFLAGS_ALL += -I$(srcdir)/arch/$(ARCH) -I$(srcdir)/arch/generic -Iobj/src/internal -I$(srcdir)/src/include -I$(srcdir)/src/internal -Iobj/include -I$(srcdir)/include + CFLAGS_ALL += $(CPPFLAGS) $(CFLAGS_AUTO) $(CFLAGS) + + LDFLAGS_ALL = $(LDFLAGS_AUTO) $(LDFLAGS) +diff --git a/ldso/dynlink.c b/ldso/dynlink.c +index ec921dfd..7c119c55 100644 +--- a/ldso/dynlink.c ++++ b/ldso/dynlink.c +@@ -22,6 +22,8 @@ + #include "dynlink.h" + #include "malloc_impl.h" + ++#define SYS_PATH_DFLT SYSLIBDIR ":" LIBDIR ++ + static void error(const char *, ...); + + #define MAXP2(a,b) (-(-(a)&-(b))) +@@ -1038,7 +1040,7 @@ static struct dso *load_library(const char *name, struct dso *needed_by) + sys_path = ""; + } + } +- if (!sys_path) sys_path = "/lib:/usr/local/lib:/usr/lib"; ++ if (!sys_path) sys_path = SYS_PATH_DFLT; + fd = path_open(name, sys_path, buf, sizeof buf); + } + pathname = buf; +-- +2.7.4 +meta/recipes-core/musl/musl_git.bb +1
-1@@ -12,6 +12,7 @@ PV = "1.1.20+git${SRCPV}" SRC_URI = "git://git.musl-libc.org/musl \ file://0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch \ + file://0002-ldso-Use-syslibdir-and-libdir-as-default-pathes-to-l.patch \ " S = "${WORKDIR}/git" --2.7.4
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [PATCH 06/13] musl: Create default library search path based on configuration
Quoted 14 lines · Khem Raj
Quoted 12 lines · Serhey Popovych
In absence of /etc/ld-musl-$(ARCH).path file musl uses hardcoded default search path "/lib:/usr/local/lib:/usr/lib". This works for cases when system libraries installed in one of these pathes.
However if lib64 or libx32 used as system library directories and no usr merge functionality enabled for distro musl dynamic loader cannot find libraries and finally execute binaries.
Found while working on support for musl on powerpc64 builds where lib64 variant is used regardless of multilib being on or off.
Quoted 8 lines
Quoted 2 lines
Fix by creating default search path based on configuration time values for syslibdir and libdir.
Lets take this fix to musl upstream at the same time. I think it does have some value
but if upstream does not agree then we are in for supporting this forever, and I would like
us to have upstream review on it first.
Will do that. Passing defines in CFLAGS isn't best approach. Maybe upstream suggests something better.
Quoted 96 lines
Quoted 96 lines
Signed-off-by Serhey Popovych <[email protected]>--- ...slibdir-and-libdir-as-default-pathes-to-l.patch | 61 ++++++++++++++++++++++ meta/recipes-core/musl/musl_git.bb | 1 + 2 files changed, 62 insertions(+) create mode 100644 meta/recipes-core/musl/musl/0002-ldso-Use-syslibdir-and-libdir-as-default-pathes-to-l.patchmeta/recipes-core/musl/musl/0002-ldso-Use-syslibdir-and-libdir-as-default-pathes-to-l.patch new file +61
-0@@ -0,0 +1,61 @@ +From 5a2886f81dbca3f2ed28eebe7d27d471da278db8 Mon Sep 17 00:00:00 2001 +From: Serhey Popovych <[email protected]> +Date: Tue, 11 Dec 2018 05:44:20 -0500 +Subject: [PATCH] ldso: Use syslibdir and libdir as default pathes to libdirs + +In absence of /etc/ld-musl-$(ARCH).path ldso uses default path to search +libraries /lib:/usr/local/lib:/usr/lib. + +However this path isn't relevant in case when library is put in dirs +like lib64 or libx32. + +Adjust CFLAGS_ALL to pass syslibdir as SYSLIBDIR and libdir as LIBDIR +preprocessor macroses to construct default ldso library search path +in ldso/dynlink.c::SYS_PATH_DFLT. + +Upstream-Status: Pending +Signed-off-by: Serhey Popovych <[email protected]> +--- + Makefile | 3 ++- + ldso/dynlink.c | 4 +++- + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index b46f8ca4..c07e4ae8 100644 +--- a/Makefile ++++ b/Makefile +@@ -46,7 +46,8 @@ CFLAGS_AUTO = -Os -pipe + CFLAGS_C99FSE = -std=c99 -ffreestanding -nostdinc + + CFLAGS_ALL = $(CFLAGS_C99FSE) +-CFLAGS_ALL += -D_XOPEN_SOURCE=700 -I$(srcdir)/arch/$(ARCH) -I$(srcdir)/arch/generic -Iobj/src/internal -I$(srcdir)/src/include -I$(srcdir)/src/internal -Iobj/include -I$(srcdir)/include ++CFLAGS_ALL += -D_XOPEN_SOURCE=700 -DSYSLIBDIR='"$(syslibdir)"' -DLIBDIR='"$(libdir)"' ++CFLAGS_ALL += -I$(srcdir)/arch/$(ARCH) -I$(srcdir)/arch/generic -Iobj/src/internal -I$(srcdir)/src/include -I$(srcdir)/src/internal -Iobj/include -I$(srcdir)/include + CFLAGS_ALL += $(CPPFLAGS) $(CFLAGS_AUTO) $(CFLAGS) + + LDFLAGS_ALL = $(LDFLAGS_AUTO) $(LDFLAGS) +diff --git a/ldso/dynlink.c b/ldso/dynlink.c +index ec921dfd..7c119c55 100644 +--- a/ldso/dynlink.c ++++ b/ldso/dynlink.c +@@ -22,6 +22,8 @@ + #include "dynlink.h" + #include "malloc_impl.h" + ++#define SYS_PATH_DFLT SYSLIBDIR ":" LIBDIR ++ + static void error(const char *, ...); + + #define MAXP2(a,b) (-(-(a)&-(b))) +@@ -1038,7 +1040,7 @@ static struct dso *load_library(const char *name, struct dso *needed_by) + sys_path = ""; + } + } +- if (!sys_path) sys_path = "/lib:/usr/local/lib:/usr/lib"; ++ if (!sys_path) sys_path = SYS_PATH_DFLT; + fd = path_open(name, sys_path, buf, sizeof buf); + } + pathname = buf; +-- +2.7.4 +meta/recipes-core/musl/musl_git.bb +1
-1@@ -12,6 +12,7 @@ PV = "1.1.20+git${SRCPV}" SRC_URI = "git://git.musl-libc.org/musl \ file://0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch \ + file://0002-ldso-Use-syslibdir-and-libdir-as-default-pathes-to-l.patch \ " S = "${WORKDIR}/git" --2.7.4
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
PATCH 7/13 musl: Ensure GLIBC_LDSO symlink target does not exist on reinstall
In reply to Serhey PopovychOtherwise do_install task will fail on rebuild.
--- meta/recipes-core/musl/musl_git.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/musl/musl_git.bb +1 -1
@@ -61,7 +61,7 @@ do_install() { oe_runmake install DESTDIR='${D}' install -d ${D}${bindir} - rm -f ${D}${bindir}/ldd + rm -f ${D}${bindir}/ldd ${D}${GLIBC_LDSO} lnr ${D}${libdir}/libc.so ${D}${bindir}/ldd lnr ${D}${libdir}/libc.so ${D}${GLIBC_LDSO} for l in crypt dl m pthread resolv rt util xnet
Signature · 1 line
2.7.4
Re: [PATCH 07/13] musl: Ensure GLIBC_LDSO symlink target does not exist on reinstall
Quoted 13 lines · Serhey Popovych
Otherwise
do_installtask will fail on rebuild.Signed-off-by Serhey Popovych <[email protected]>--- meta/recipes-core/musl/musl_git.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)meta/recipes-core/musl/musl_git.bb +0
-0
meta/recipes-core/musl/musl_git.bb do_install() { · line 64
Quoted 5 lines
meta/recipes-core/musl/musl_git.bb +1
-1@@ -61,7 +61,7 @@ do_install() { oe_runmake install DESTDIR='${D}' install -d ${D}${bindir} - rm -f ${D}${bindir}/ldd + rm -f ${D}${bindir}/ldd ${D}${GLIBC_LDSO}
The correct fix here is actually to remove this line entirely. The official ruling is that there should be no expectation that re-running do_install should work and patches to make it work are not acceptable.
http://lists.openembedded.org/pipermail/openembedded-core/2018-September/273723.html
Quoted 11 lines
meta/recipes-core/musl/musl_git.bb +0
-1lnr ${D}${libdir}/libc.so ${D}${bindir}/ldd lnr ${D}${libdir}/libc.so ${D}${GLIBC_LDSO} for l in crypt dl m pthread resolv rt util xnet --2.7.4
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [PATCH 07/13] musl: Ensure GLIBC_LDSO symlink target does not exist on reinstall
Quoted 27 lines · Andre McCurdy
Quoted 13 lines · Serhey Popovych
Otherwise
do_installtask will fail on rebuild.Signed-off-by Serhey Popovych <[email protected]>--- meta/recipes-core/musl/musl_git.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)meta/recipes- renamed from meta/recipes-core/musl/musl_git.bb +0
-0core/musl/musl_git.bb
index 9cc875c..4593cde 100644meta/recipes-core/musl/musl_git.bb do_install() { · line 64
Quoted 5 lines
meta/recipes-core/musl/musl_git.bb +1
-1@@ -61,7 +61,7 @@ do_install() { oe_runmake install DESTDIR='${D}' install -d ${D}${bindir} - rm -f ${D}${bindir}/ldd + rm -f ${D}${bindir}/ldd ${D}${GLIBC_LDSO}The correct fix here is actually to remove this line entirely. The official ruling is that there should be no expectation that re- running
do_installshould work and patches to make it work are not acceptable.
Lets be clear, re-running the do_install task *is* supported and works today. It is actually meant to work when re-run. do_install clears out ${D} at its start so we can assume in do_install functions that it is empty at the start of the function.
The only problem may be if you're manually re-running the do_install script in WORKDIR/temp. If you're doing that, you have other problems like the missing fakeroot environment to handle so the non-empty directory is only one minor issue, you're missing other setup pieces as well.
Cheers,
Richard
Re: [PATCH 07/13] musl: Ensure GLIBC_LDSO symlink target does not exist on reinstall
Quoted 28 lines · Richard Purdie
Quoted 27 lines · Andre McCurdy
Quoted 13 lines · Serhey Popovych
Otherwise
do_installtask will fail on rebuild.Signed-off-by Serhey Popovych <[email protected]>--- meta/recipes-core/musl/musl_git.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)meta/recipes- renamed from meta/recipes-core/musl/musl_git.bb +0
-0core/musl/musl_git.bb
index 9cc875c..4593cde 100644meta/recipes-core/musl/musl_git.bb do_install() { · line 64
Quoted 5 lines
meta/recipes-core/musl/musl_git.bb +1
-1@@ -61,7 +61,7 @@ do_install() { oe_runmake install DESTDIR='${D}' install -d ${D}${bindir} - rm -f ${D}${bindir}/ldd + rm -f ${D}${bindir}/ldd ${D}${GLIBC_LDSO}The correct fix here is actually to remove this line entirely. The official ruling is that there should be no expectation that re- running
do_installshould work and patches to make it work are not acceptable.
Quoted 6 lines
Lets be clear, re-running the
do_installtask *is* supported and works today. It is actually meant to work when re-run.do_installclears out ${D} at its start so we can assume indo_installfunctions that it is empty at the start of the function.
It seems do_install does not clear ${D} or I do something wrong:
$ bitbake core-image-sato <success>
<Adjust gcc/musl recipe and then run>
$ bitbake core-image-sato
...
/image/usr/lib64/libc.so /home/serhe/devel/git/openembedded-core/build/tmp-musl/work/ppc64p8le-oe-linux-musl/musl/1.1.20+gitAUTOINC+39ef612aa1-r0/image/lib64/ld-musl-powerpc64le.so.1
|| true | Traceback (most recent call last): | File "/home/serhe/devel/git/openembedded-core/scripts/lnr", line 21,
in <module>
| os.symlink(target, linkname)
| FileExistsError: [Errno 17] File exists: 'image/usr/lib64/libc.so' -> '/home/serhe/devel/git/openembedded-core/build/tmp-musl/work/ppc64p8le-oe-linux-musl/musl/1.1.20+gitAUTOINC+39ef612aa1-r0/imageNone' | WARNING:/home/serhe/devel/git/openembedded-core/build/tmp-musl/work/ppc64p8le-oe-linux-musl/musl/1.1.20+gitAUTOINC+39ef612aa1-r0/temp/run.do_install.77856:1 exit 1 from 'lnr /home/serhe/devel/git/openembedded-core/build/tmp-musl/work/ppc64p8le-oe-linux-musl/musl/1.1.20+gitAUTOINC+39ef612aa1-r0/image/usr/lib64/libc.so /home/serhe/devel/git/openembedded-core/build/tmp-musl/work/ppc64p8le-oe-linux-musl/musl/1.1.20+gitAUTOINC+39ef612aa1-r0/imageNone' | ERROR: Function failed: do_install (log file is located at /home/serhe/devel/git/openembedded-core/build/tmp-musl/work/ppc64p8le-oe-linux-musl/musl/1.1.20+gitAUTOINC+39ef612aa1-r0/temp/log.do_install.77856)
ERROR: Task
(/home/serhe/devel/git/openembedded-core/meta/recipes-core/musl/musl_git.bb:do_install)
failed with exit code '1'
NOTE: Tasks Summary: Attempted 2713 tasks of which 2703 didn't need to
be rerun and 1 failed.
...
Quoted 6 lines
The only problem may be if you're manually re-running the
do_installscript in WORKDIR/temp. If you're doing that, you have other problems like the missing fakeroot environment to handle so the non-empty directory is only one minor issue, you're missing other setup pieces as well.
I haven't play with do_install scripts in WORKDIR/temp. Only do_configure and do_build. But anyway thank for pointing for potential problems.
Quoted 7 lines
Cheers,
Richard
Re: [PATCH 07/13] musl: Ensure GLIBC_LDSO symlink target does not exist on reinstall
Quoted 100 lines · Serhey Popovych
Quoted 32 lines · Richard Purdie
Quoted 29 lines · Andre McCurdy
Quoted 13 lines · Serhey Popovych
Otherwise
do_installtask will fail on rebuild.Signed-off-by Serhey Popovych <[email protected]>--- meta/recipes-core/musl/musl_git.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)meta/recipes- renamed from meta/recipes-core/musl/musl_git.bb +0
-0core/musl/musl_git.bb
index 9cc875c..4593cde 100644meta/recipes-core/musl/musl_git.bb do_install() { · line 64
Quoted 5 lines
meta/recipes-core/musl/musl_git.bb +1
-1@@ -61,7 +61,7 @@ do_install() { oe_runmake install DESTDIR='${D}' install -d ${D}${bindir} - rm -f ${D}${bindir}/ldd + rm -f ${D}${bindir}/ldd ${D}${GLIBC_LDSO}The correct fix here is actually to remove this line entirely. The
official ruling is that there should be no expectation that re- runningdo_installshould work and patches to make it work are not
acceptable.Quoted 7 lines
Lets be clear, re-running the
do_installtask *is* supported and works
today. It is actually meant to work when re-run.do_installclears out
${D} at its start so we can assume indo_installfunctions that it is
empty at the start of the function.It seems
do_installdoes not clear ${D} or I do something wrong:$ bitbake core-image-sato <success><Adjust gcc/musl recipe and then run>
$ bitbake core-image-sato...
/image/usr/lib64/libc.so/home/serhe/devel/git/openembedded-core/build/tmp-musl/work/ppc64p8le-oe-linux-musl/musl/1.1.20+gitAUTOINC+39ef612aa1- r0/image/lib64/ld-musl-powerpc64le.so.1Quoted 4 lines
Quoted 1 line
true
Traceback (most recent call last):
File "/home/serhe/devel/git/openembedded-core/scripts/lnr", line
21,in <module>
Quoted 3 lines
os.symlink(target, linkname)
FileExistsError: [Errno 17] File exists: 'image/usr/lib64/libc.so' ->'
/home/serhe/devel/git/openembedded-core/build/tmp-musl/work/ppc64p8le-oe-linux-musl/musl/1.1.20+gitAUTOINC+39ef612aa1- r0/imageNone'Quoted 1 line
WARNING:
/home/serhe/devel/git/openembedded-core/build/tmp-musl/work/ppc64p8le-oe-linux-musl/musl/1.1.20+gitAUTOINC+39ef612aa1- r0/temp/run.do_install.77856:1
exit 1 from 'lnr/home/serhe/devel/git/openembedded-core/build/tmp-musl/work/ppc64p8le-oe-linux-musl/musl/1.1.20+gitAUTOINC+39ef612aa1- r0/image/usr/lib64/libc.so/home/serhe/devel/git/openembedded-core/build/tmp-musl/work/ppc64p8le-oe-linux-musl/musl/1.1.20+gitAUTOINC+39ef612aa1- r0/imageNone'Quoted 1 line
ERROR: Function failed:
do_install(log file is located at
/home/serhe/devel/git/openembedded-core/build/tmp-musl/work/ppc64p8le-oe-linux-musl/musl/1.1.20+gitAUTOINC+39ef612aa1- r0/temp/log.do_install.77856)
ERROR: Task (/home/serhe/devel/git/openembedded-core/meta/recipes-core/musl/musl_git.bb:do_install)
failed with exit code '1'
NOTE: Tasks Summary: Attempted 2713 tasks of which 2703 didn't need to
be rerun and 1 failed....
Quoted 8 lines
The only problem may be if you're manually re-running the
do_install
script in WORKDIR/temp. If you're doing that, you have other problems
like the missing fakeroot environment to handle so the non-empty directory is only one minor issue, you're missing other setup pieces as
well.
Quoted 4 lines
I haven't play with
do_installscripts in WORKDIR/temp. Onlydo_configureanddo_build. But anyway thank for pointing for potential
problems.
I just tried "bitbake musl", then "bitbake musl -c install -f" which should have reproduced the above but it worked fine. Admittedly I was using MACHINE=qemux86-64. Do those two steps break for you?
Something isn't adding up here and I'd like to get to the bottom of it...
Cheers,
Richard
Re: [PATCH 07/13] musl: Ensure GLIBC_LDSO symlink target does not exist on reinstall
Quoted 101 lines · [email protected] wrote:
Quoted 100 lines · Serhey Popovych
Quoted 32 lines · Richard Purdie
Quoted 29 lines · Andre McCurdy
Quoted 13 lines · Serhey Popovych
Otherwise
do_installtask will fail on rebuild.Signed-off-by Serhey Popovych <[email protected]>--- meta/recipes-core/musl/musl_git.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)meta/recipes- renamed from meta/recipes-core/musl/musl_git.bb +0
-0core/musl/musl_git.bb
index 9cc875c..4593cde 100644meta/recipes-core/musl/musl_git.bb do_install() { · line 64
Quoted 5 lines
meta/recipes-core/musl/musl_git.bb +1
-1@@ -61,7 +61,7 @@ do_install() { oe_runmake install DESTDIR='${D}' install -d ${D}${bindir} - rm -f ${D}${bindir}/ldd + rm -f ${D}${bindir}/ldd ${D}${GLIBC_LDSO}The correct fix here is actually to remove this line entirely. The
official ruling is that there should be no expectation that re- runningdo_installshould work and patches to make it work are not
acceptable.Quoted 7 lines
Lets be clear, re-running the
do_installtask *is* supported and works
today. It is actually meant to work when re-run.do_installclears out
${D} at its start so we can assume indo_installfunctions that it is
empty at the start of the function.It seems
do_installdoes not clear ${D} or I do something wrong:$ bitbake core-image-sato <success><Adjust gcc/musl recipe and then run>
$ bitbake core-image-sato...
/image/usr/lib64/libc.so/home/serhe/devel/git/openembedded-core/build/tmp-musl/work/ppc64p8le-oe-linux-musl/musl/1.1.20+gitAUTOINC+39ef612aa1- r0/image/lib64/ld-musl-powerpc64le.so.1Quoted 4 lines
Quoted 1 line
true
Traceback (most recent call last):
File "/home/serhe/devel/git/openembedded-core/scripts/lnr", line
21,in <module>
Quoted 3 lines
os.symlink(target, linkname)
FileExistsError: [Errno 17] File exists: 'image/usr/lib64/libc.so' ->'
/home/serhe/devel/git/openembedded-core/build/tmp-musl/work/ppc64p8le-oe-linux-musl/musl/1.1.20+gitAUTOINC+39ef612aa1- r0/imageNone'Quoted 1 line
WARNING:
/home/serhe/devel/git/openembedded-core/build/tmp-musl/work/ppc64p8le-oe-linux-musl/musl/1.1.20+gitAUTOINC+39ef612aa1- r0/temp/run.do_install.77856:1
exit 1 from 'lnr/home/serhe/devel/git/openembedded-core/build/tmp-musl/work/ppc64p8le-oe-linux-musl/musl/1.1.20+gitAUTOINC+39ef612aa1- r0/image/usr/lib64/libc.so/home/serhe/devel/git/openembedded-core/build/tmp-musl/work/ppc64p8le-oe-linux-musl/musl/1.1.20+gitAUTOINC+39ef612aa1- r0/imageNone'Quoted 1 line
ERROR: Function failed:
do_install(log file is located at
/home/serhe/devel/git/openembedded-core/build/tmp-musl/work/ppc64p8le-oe-linux-musl/musl/1.1.20+gitAUTOINC+39ef612aa1- r0/temp/log.do_install.77856)
ERROR: Task (/home/serhe/devel/git/openembedded-core/meta/recipes-core/musl/musl_git.bb:do_install)
failed with exit code '1'
NOTE: Tasks Summary: Attempted 2713 tasks of which 2703 didn't need to
be rerun and 1 failed....
Quoted 8 lines
The only problem may be if you're manually re-running the
do_install
script in WORKDIR/temp. If you're doing that, you have other problems
like the missing fakeroot environment to handle so the non-empty directory is only one minor issue, you're missing other setup pieces as
well.
Quoted 8 lines
Quoted 4 lines
I haven't play with
do_installscripts in WORKDIR/temp. Onlydo_configureanddo_build. But anyway thank for pointing for potential
problems.I just tried "bitbake musl", then "bitbake musl -c install -f" which should have reproduced the above but it worked fine. Admittedly I was using MACHINE=qemux86-64. Do those two steps break for you?
Tried for ppc: issue above not reproducible. It seems I ran into unsupported configuration somehow. Sorry for noise.
Quoted 11 lines
Something isn't adding up here and I'd like to get to the bottom of it...
Cheers,
Richard
PATCH 8/13 openssl: Skip assembler optimized code for powerpc64 with musl
In reply to Serhey PopovychThis code is written for elfv1 ABI in mind and linked as such: disable all optimizations at the moment when building for powerpc64 with musl.
--- meta/recipes-connectivity/openssl/openssl10_1.0.2q.bb | 1 + meta/recipes-connectivity/openssl/openssl_1.1.1a.bb | 1 + 2 files changed, 2 insertions(+)
meta/recipes-connectivity/openssl/openssl10_1.0.2q.bb +1 -0
@@ -81,6 +81,7 @@ CCACHE = "" TERMIO ?= "-DTERMIO" TERMIO_libc-musl = "-DTERMIOS" +EXTRA_OECONF_append_libc-musl_powerpc64 = " no-asm" CFLAG = "${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', '-DL_ENDIAN', '-DB_ENDIAN', d)} \ ${TERMIO} ${CFLAGS} -Wall"
meta/recipes-connectivity/openssl/openssl_1.1.1a.bb +1 -0
@@ -35,6 +35,7 @@ do_configure[cleandirs] = "${B}" #| ./libcrypto.so: undefined reference to `setcontext' #| ./libcrypto.so: undefined reference to `makecontext' EXTRA_OECONF_append_libc-musl = " no-async" +EXTRA_OECONF_append_libc-musl_powerpc64 = " no-asm" # This prevents openssl from using getrandom() which is not available on older glibc versions # (native versions can be built with newer glibc, but then relocated onto a system with older glibc)
Signature · 1 line
2.7.4
PATCH 9/13 python3: Fix do_configure check platform triplet error (2)
In reply to Serhey PopovychWhen building for powerpc 32bit with musl following error triggered from do_configure:
checking for the platform triplet based on compiler characteristics... powerpc-linux-gnu
configure: error: internal configure error for the platform triplet, please file a bug report
This is caused by PLATFORM_TRIPLET != MULTIARCH mismatch since MULTIARCH in case of musl is powerpc-linux-musl. Since triplet is used as part module name as described in PEP-3149 to make fix less intrusive alias powerpc-linux-musl to powerpc-linux-gnu to avoid possible runtime (e.g. tests) incompatibilities later.
Fix was inspired by commit cda0ef61d373 ("python3: fix do_configure check platform triplet error").
--- .../tweak-MULTIARCH-for-powerpc-linux-musl.patch | 40 ++++++++++++++++++++++ meta/recipes-devtools/python/python3_3.5.6.bb | 1 + 2 files changed, 41 insertions(+) create mode 100644 meta/recipes-devtools/python/python3/tweak-MULTIARCH-for-powerpc-linux-musl.patch
meta/recipes-devtools/python/python3/tweak-MULTIARCH-for-powerpc-linux-musl.patch new file +40 -0
@@ -0,0 +1,40 @@ +From 7362464383bbd54f8e6be4389f2c74c0717bc6e1 Mon Sep 17 00:00:00 2001 +From: Serhey Popovych <[email protected]> +Date: Sat, 8 Dec 2018 11:24:06 -0500 +Subject: [PATCH] configure.ac: tweak MULTIARCH for powerpc-linux-musl + +For musl builds, the MULTIARCH is powerpc-linux-musl and configure.ac +does not have lines to recognize it causing configure error for the +platform triplet when building for powerpc 32bit. + +This is feature described in PEP-3149 and to prevent possible runtime +compatibility issues we map powerpc-linux-musl to powerpc-linux-gnu. + +Look at similar change by Hongxu Jia <hongxu.jia@> presended in +tweak-MULTIARCH-for-powerpc-linux-gnuspe.patch to handle p1022ds BSP +builds. + +Upstream-Status: Pending +Signed-off-by: Serhey Popovych <[email protected]> +--- + configure.ac | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 95c98d1..1a4d8aa 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -752,6 +752,10 @@ if test x$MULTIARCH = xpowerpc-linux-gnuspev1 + then + MULTIARCH="powerpc-linux-gnuspe" + fi ++if test x$MULTIARCH = xpowerpc-linux-musl ++then ++ MULTIARCH="powerpc-linux-gnu" ++fi + + AC_SUBST(MULTIARCH) + +-- +2.7.4 +
meta/recipes-devtools/python/python3_3.5.6.bb +1 -0
@@ -13,6 +13,7 @@ file://130-readline-setup.patch \ file://150-fix-setupterm.patch \ file://0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch \ file://tweak-MULTIARCH-for-powerpc-linux-gnuspe.patch \ +file://tweak-MULTIARCH-for-powerpc-linux-musl.patch \ file://support_SOURCE_DATE_EPOCH_in_py_compile.patch \ ${DISTRO_SRC_URI} \ "
Signature · 1 line
2.7.4
PATCH 10/13 gcc: Fix preprocessor redefines for header pathes
In reply to Serhey PopovychWhen building for powerpc64 using musl as C library we get preprocessor macro redefinition errors since gcc-configure-common.inc adds #define of STANDARD_STARTFILE_PREFIX_1 and STANDARD_STARTFILE_PREFIX_2 to gcc/defaults.h after ones added by a patch that ensures target gcc headers included.
Since gcc-configure-common.inc included in every gcc recipe either directly or indirectly, do_configure task is not disabled/deleted for any of them (except gcc-source.inc) and there is no precondition that skips gcc/defaults.h patching in gcc-configure-common.inc::do_configure_prepend() we can just remove conflicting parts of mentioned above patch to have single place where start files prefixes defined in do_configure() task.
--- ...Ensure-target-gcc-headers-can-be-included.patch | 36 ---------------------- ...Ensure-target-gcc-headers-can-be-included.patch | 36 ---------------------- 2 files changed, 72 deletions(-)
meta/recipes-devtools/gcc/gcc-7.3/0030-Ensure-target-gcc-headers-can-be-included.patch +0 -36
@@ -57,42 +57,6 @@ index 10b96eca0a7..c8da0884872 100644 #ifdef LOCAL_INCLUDE_DIR /* /usr/local/include comes before the fixincluded header files. */ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, -diff --git a/gcc/defaults.h b/gcc/defaults.h -index 7ad92d920f8..39848cc9c0e 100644 ---- a/gcc/defaults.h -+++ b/gcc/defaults.h -@@ -1475,4 +1475,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - #define DWARF_GNAT_ENCODINGS_DEFAULT DWARF_GNAT_ENCODINGS_GDB - #endif - -+/* Default prefixes to attach to command names. */ -+ -+#ifndef STANDARD_STARTFILE_PREFIX_1 -+#define STANDARD_STARTFILE_PREFIX_1 "/lib/" -+#endif -+#ifndef STANDARD_STARTFILE_PREFIX_2 -+#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/" -+#endif -+ - #endif /* ! GCC_DEFAULTS_H */ -diff --git a/gcc/gcc.c b/gcc/gcc.c -index c73d4023987..b27245dbf77 100644 ---- a/gcc/gcc.c -+++ b/gcc/gcc.c -@@ -1472,13 +1472,6 @@ static const char *gcc_libexec_prefix; - - /* Default prefixes to attach to command names. */ - --#ifndef STANDARD_STARTFILE_PREFIX_1 --#define STANDARD_STARTFILE_PREFIX_1 "/lib/" --#endif --#ifndef STANDARD_STARTFILE_PREFIX_2 --#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/" --#endif -- - #ifdef CROSS_DIRECTORY_STRUCTURE /* Don't use these prefixes for a cross compiler. */ - #undef MD_EXEC_PREFIX - #undef MD_STARTFILE_PREFIX -- 2.12.2
meta/recipes-devtools/gcc/gcc-8.2/0023-Ensure-target-gcc-headers-can-be-included.patch +0 -36
@@ -57,42 +57,6 @@ index b36a979d5ba..e2e187dedaf 100644 #ifdef LOCAL_INCLUDE_DIR /* /usr/local/include comes before the fixincluded header files. */ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, -diff --git a/gcc/defaults.h b/gcc/defaults.h -index 78a08a33f12..c8851277674 100644 ---- a/gcc/defaults.h -+++ b/gcc/defaults.h -@@ -1451,4 +1451,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - #define DWARF_GNAT_ENCODINGS_DEFAULT DWARF_GNAT_ENCODINGS_GDB - #endif - -+/* Default prefixes to attach to command names. */ -+ -+#ifndef STANDARD_STARTFILE_PREFIX_1 -+#define STANDARD_STARTFILE_PREFIX_1 "/lib/" -+#endif -+#ifndef STANDARD_STARTFILE_PREFIX_2 -+#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/" -+#endif -+ - #endif /* ! GCC_DEFAULTS_H */ -diff --git a/gcc/gcc.c b/gcc/gcc.c -index 570cdc00034..3fb64d453f1 100644 ---- a/gcc/gcc.c -+++ b/gcc/gcc.c -@@ -1464,13 +1464,6 @@ static const char *gcc_libexec_prefix; - - /* Default prefixes to attach to command names. */ - --#ifndef STANDARD_STARTFILE_PREFIX_1 --#define STANDARD_STARTFILE_PREFIX_1 "/lib/" --#endif --#ifndef STANDARD_STARTFILE_PREFIX_2 --#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/" --#endif -- - #ifdef CROSS_DIRECTORY_STRUCTURE /* Don't use these prefixes for a cross compiler. */ - #undef MD_EXEC_PREFIX - #undef MD_STARTFILE_PREFIX -- 2.17.0
Signature · 1 line
2.7.4
PATCH 11/13 gcc: More places to patch to disable ldbl 128 for musl on PPC
In reply to Serhey PopovychThere are four functions using TFmode type (128bit) that isn't available when building with musl. Move each of them from common ppc64-fp.c to individual files referenced from t-float128 that used when ldbl 128 enabled at configure time.
For gcc-7.3 if -mfloat128 is given -mfloat128-type must be given too.
Exclude ibm-ldouble.c when ldbl 128 isn't enabled at config time.
Build and boot tested with musl (no float128) and glibc (float128 and ibm128 on PowerPC64).
--- ...44-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch | 391 ++++++++++++++++++++- ...34-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch | 342 +++++++++++++++++- 2 files changed, 731 insertions(+), 2 deletions(-)
meta/recipes-devtools/gcc/gcc-7.3/0044-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch +390 -1
@@ -36,14 +36,385 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux index 4f6d4c4a4d2..c50dd94a2da 100644 --- a/libgcc/config/rs6000/t-linux +++ b/libgcc/config/rs6000/t-linux -@@ -1,3 +1,6 @@ +@@ -1,3 +1,9 @@ SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver -HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc +ifeq ($(with_ldbl128),yes) +HOST_LIBGCC2_CFLAGS += -mlong-double-128 ++else ++# We do not want to build ibm-ldouble.c. ++LIB2ADD := $(filter-out %ibm-ldouble.c, $(LIB2ADD)) +endif +HOST_LIBGCC2_CFLAGS += -mno-minimal-toc +diff --git a/libgcc/config/rs6000/fixtfdi.c b/libgcc/config/rs6000/fixtfdi.c +new file mode 100644 +index 0000000..9b979d0 +--- /dev/null ++++ b/libgcc/config/rs6000/fixtfdi.c +@@ -0,0 +1,42 @@ ++/* Software floating-point emulation. ++ Convert a to 64bit signed integer ++ Copyright (C) 1997-2016 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Contributed by Richard Henderson ([email protected]) and ++ Jakub Jelinek ([email protected]). ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ In addition to the permissions in the GNU Lesser General Public ++ License, the Free Software Foundation gives you unlimited ++ permission to link the compiled version of this file into ++ combinations with other programs, and to distribute those ++ combinations without any restriction coming from the use of this ++ file. (The Lesser General Public License restrictions do apply in ++ other respects; for example, they cover modification of the file, ++ and distribution when not linked into a combine executable.) ++ ++ The GNU C Library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ <http://www.gnu.org/licenses/>. */ ++ ++#ifdef _ARCH_PPC64 ++#include "soft-fp.h" ++#include "quad-float128.h" ++ ++DItype ++__fixtfdi (TFtype a) ++{ ++ if (a < 0) ++ return - __fixunstfdi (-a); ++ return __fixunstfdi (a); ++} ++#endif +diff --git a/libgcc/config/rs6000/fixunstfdi.c b/libgcc/config/rs6000/fixunstfdi.c +new file mode 100644 +index 0000000..65e9590 +--- /dev/null ++++ b/libgcc/config/rs6000/fixunstfdi.c +@@ -0,0 +1,58 @@ ++/* Software floating-point emulation. ++ Convert a to 64bit unsigned integer ++ Copyright (C) 1997-2016 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Contributed by Richard Henderson ([email protected]) and ++ Jakub Jelinek ([email protected]). ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ In addition to the permissions in the GNU Lesser General Public ++ License, the Free Software Foundation gives you unlimited ++ permission to link the compiled version of this file into ++ combinations with other programs, and to distribute those ++ combinations without any restriction coming from the use of this ++ file. (The Lesser General Public License restrictions do apply in ++ other respects; for example, they cover modification of the file, ++ and distribution when not linked into a combine executable.) ++ ++ The GNU C Library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ <http://www.gnu.org/licenses/>. */ ++ ++#ifdef _ARCH_PPC64 ++#include "soft-fp.h" ++#include "quad-float128.h" ++ ++DItype ++__fixunstfdi (TFtype a) ++{ ++ if (a < 0) ++ return 0; ++ ++ /* Compute high word of result, as a flonum. */ ++ const TFtype b = (a / (((UDItype) 1) << (sizeof (SItype) * 8))); ++ /* Convert that to fixed (but not to DItype!), ++ and shift it into the high word. */ ++ UDItype v = (USItype) b; ++ v <<= (sizeof (SItype) * 8); ++ /* Remove high part from the TFtype, leaving the low part as flonum. */ ++ a -= (TFtype) v; ++ /* Convert that to fixed (but not to DItype!) and add it in. ++ Sometimes A comes out negative. This is significant, since ++ A has more bits than a long int does. */ ++ if (a < 0) ++ v -= (USItype) (-a); ++ else ++ v += (USItype) a; ++ return v; ++} ++#endif +diff --git a/libgcc/config/rs6000/floatditf.c b/libgcc/config/rs6000/floatditf.c +new file mode 100644 +index 0000000..20ad4c6 +--- /dev/null ++++ b/libgcc/config/rs6000/floatditf.c +@@ -0,0 +1,47 @@ ++/* Software floating-point emulation. ++ Convert a 64bit signed integer to IEEE quad ++ Copyright (C) 1997-2016 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Contributed by Richard Henderson ([email protected]) and ++ Jakub Jelinek ([email protected]). ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ In addition to the permissions in the GNU Lesser General Public ++ License, the Free Software Foundation gives you unlimited ++ permission to link the compiled version of this file into ++ combinations with other programs, and to distribute those ++ combinations without any restriction coming from the use of this ++ file. (The Lesser General Public License restrictions do apply in ++ other respects; for example, they cover modification of the file, ++ and distribution when not linked into a combine executable.) ++ ++ The GNU C Library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ <http://www.gnu.org/licenses/>. */ ++ ++#ifdef _ARCH_PPC64 ++#include "soft-fp.h" ++#include "double.h" ++#include "quad-float128.h" ++ ++TFtype ++__floatditf (DItype u) ++{ ++ DFtype dh, dl; ++ ++ dh = (SItype) (u >> (sizeof (SItype) * 8)); ++ dh *= 2.0 * (((UDItype) 1) << ((sizeof (SItype) * 8) - 1)); ++ dl = (USItype) (u & ((((UDItype) 1) << (sizeof (SItype) * 8)) - 1)); ++ ++ return (TFtype) dh + (TFtype) dl; ++} ++#endif +diff --git a/libgcc/config/rs6000/floatunditf.c b/libgcc/config/rs6000/floatunditf.c +new file mode 100644 +index 0000000..23dbde2 +--- /dev/null ++++ b/libgcc/config/rs6000/floatunditf.c +@@ -0,0 +1,47 @@ ++/* Software floating-point emulation. ++ Convert a 64bit unsigned integer to IEEE quad ++ Copyright (C) 1997-2016 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Contributed by Richard Henderson ([email protected]) and ++ Jakub Jelinek ([email protected]). ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ In addition to the permissions in the GNU Lesser General Public ++ License, the Free Software Foundation gives you unlimited ++ permission to link the compiled version of this file into ++ combinations with other programs, and to distribute those ++ combinations without any restriction coming from the use of this ++ file. (The Lesser General Public License restrictions do apply in ++ other respects; for example, they cover modification of the file, ++ and distribution when not linked into a combine executable.) ++ ++ The GNU C Library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ <http://www.gnu.org/licenses/>. */ ++ ++#ifdef _ARCH_PPC64 ++#include "soft-fp.h" ++#include "double.h" ++#include "quad-float128.h" ++ ++TFtype ++__floatunditf (UDItype u) ++{ ++ DFtype dh, dl; ++ ++ dh = (USItype) (u >> (sizeof (SItype) * 8)); ++ dh *= 2.0 * (((UDItype) 1) << ((sizeof (SItype) * 8) - 1)); ++ dl = (USItype) (u & ((((UDItype) 1) << (sizeof (SItype) * 8)) - 1)); ++ ++ return (TFtype) dh + (TFtype) dl; ++} ++#endif +diff --git a/libgcc/config/rs6000/ppc64-fp.c b/libgcc/config/rs6000/ppc64-fp.c +index 5e1cbdd..70ad3c9 100644 +--- a/libgcc/config/rs6000/ppc64-fp.c ++++ b/libgcc/config/rs6000/ppc64-fp.c +@@ -25,33 +25,20 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + <http://www.gnu.org/licenses/>. */ + + #if defined(__powerpc64__) || defined (__64BIT__) || defined(__ppc64__) +-#define TMODES + #include "fp-bit.h" + +-extern DItype __fixtfdi (TFtype); + extern DItype __fixdfdi (DFtype); + extern DItype __fixsfdi (SFtype); + extern USItype __fixunsdfsi (DFtype); + extern USItype __fixunssfsi (SFtype); +-extern TFtype __floatditf (DItype); +-extern TFtype __floatunditf (UDItype); + extern DFtype __floatdidf (DItype); + extern DFtype __floatundidf (UDItype); + extern SFtype __floatdisf (DItype); + extern SFtype __floatundisf (UDItype); +-extern DItype __fixunstfdi (TFtype); + + static DItype local_fixunssfdi (SFtype); + static DItype local_fixunsdfdi (DFtype); + +-DItype +-__fixtfdi (TFtype a) +-{ +- if (a < 0) +- return - __fixunstfdi (-a); +- return __fixunstfdi (a); +-} +- + DItype + __fixdfdi (DFtype a) + { +@@ -86,30 +73,6 @@ __fixunssfsi (SFtype a) + return (SItype) a; + } + +-TFtype +-__floatditf (DItype u) +-{ +- DFtype dh, dl; +- +- dh = (SItype) (u >> (sizeof (SItype) * 8)); +- dh *= 2.0 * (((UDItype) 1) << ((sizeof (SItype) * 8) - 1)); +- dl = (USItype) (u & ((((UDItype) 1) << (sizeof (SItype) * 8)) - 1)); +- +- return (TFtype) dh + (TFtype) dl; +-} +- +-TFtype +-__floatunditf (UDItype u) +-{ +- DFtype dh, dl; +- +- dh = (USItype) (u >> (sizeof (SItype) * 8)); +- dh *= 2.0 * (((UDItype) 1) << ((sizeof (SItype) * 8) - 1)); +- dl = (USItype) (u & ((((UDItype) 1) << (sizeof (SItype) * 8)) - 1)); +- +- return (TFtype) dh + (TFtype) dl; +-} +- + DFtype + __floatdidf (DItype u) + { +@@ -183,30 +146,6 @@ __floatundisf (UDItype u) + return (SFtype) f; + } + +-DItype +-__fixunstfdi (TFtype a) +-{ +- if (a < 0) +- return 0; +- +- /* Compute high word of result, as a flonum. */ +- const TFtype b = (a / (((UDItype) 1) << (sizeof (SItype) * 8))); +- /* Convert that to fixed (but not to DItype!), +- and shift it into the high word. */ +- UDItype v = (USItype) b; +- v <<= (sizeof (SItype) * 8); +- /* Remove high part from the TFtype, leaving the low part as flonum. */ +- a -= (TFtype) v; +- /* Convert that to fixed (but not to DItype!) and add it in. +- Sometimes A comes out negative. This is significant, since +- A has more bits than a long int does. */ +- if (a < 0) +- v -= (USItype) (-a); +- else +- v += (USItype) a; +- return v; +-} +- + /* This version is needed to prevent recursion; fixunsdfdi in libgcc + calls fixdfdi, which in turn calls calls fixunsdfdi. */ + +diff --git a/libgcc/config/rs6000/quad-float128.h b/libgcc/config/rs6000/quad-float128.h +index 7d69c87..a0c2664 100644 +--- a/libgcc/config/rs6000/quad-float128.h ++++ b/libgcc/config/rs6000/quad-float128.h +@@ -99,6 +99,11 @@ extern TItype_ppc __fixkfti (TFtype); + extern UTItype_ppc __fixunskfti (TFtype); + extern TFtype __floattikf (TItype_ppc); + extern TFtype __floatuntikf (UTItype_ppc); ++ ++extern DItype_ppc __fixtfdi (TFtype); ++extern DItype_ppc __fixunstfdi (TFtype); ++extern TFtype __floatditf (DItype_ppc); ++extern TFtype __floatunditf (UDItype_ppc); + #endif + + /* Functions using the ISA 3.0 hardware support. If the code is compiled with +diff --git a/libgcc/config/rs6000/t-float128 b/libgcc/config/rs6000/t-float128 +index 2c52ca6..3a241aa 100644 +--- a/libgcc/config/rs6000/t-float128 ++++ b/libgcc/config/rs6000/t-float128 +@@ -24,6 +24,7 @@ fp128_softfp_obj = $(fp128_softfp_static_obj) $(fp128_softfp_shared_obj) + + # New functions for software emulation + fp128_ppc_funcs = floattikf floatuntikf fixkfti fixunskfti \ ++ floatditf floatunditf fixtfdi fixunstfdi \ + extendkftf2-sw trunctfkf2-sw \ + sfp-exceptions _mulkc3 _divkc3 + +@@ -58,7 +59,7 @@ fp128_includes = $(srcdir)/soft-fp/double.h \ + $(srcdir)/soft-fp/soft-fp.h + + # Build the emulator without ISA 3.0 hardware support. +-FP128_CFLAGS_SW = -Wno-type-limits -mvsx -mfloat128 \ ++FP128_CFLAGS_SW = -Wno-type-limits -mvsx -mfloat128 -mfloat128-type \ + -mno-float128-hardware \ + -I$(srcdir)/soft-fp \ + -I$(srcdir)/config/rs6000 \ +diff --git a/libgcc/config/rs6000/t-float128-hw b/libgcc/config/rs6000/t-float128-hw +index 161062f..0476874 100644 +--- a/libgcc/config/rs6000/t-float128-hw ++++ b/libgcc/config/rs6000/t-float128-hw +@@ -21,7 +21,7 @@ fp128_ifunc_obj = $(fp128_ifunc_static_obj) $(fp128_ifunc_shared_obj) + fp128_sed_hw = -hw + + # Build the hardware support functions with appropriate hardware support +-FP128_CFLAGS_HW = -Wno-type-limits -mvsx -mfloat128 \ ++FP128_CFLAGS_HW = -Wno-type-limits -mvsx -mfloat128 -mfloat128-type \ + -mpower8-vector -mpower9-vector \ + -mfloat128-hardware \ + -I$(srcdir)/soft-fp \ diff --git a/libgcc/configure b/libgcc/configure old mode 100644 new mode 100755
@@ -96,6 +467,15 @@ index 45c459788c3..e2d19b144b8 # Check whether --with-aix-soname was given. if test "${with_aix_soname+set}" = set; then : withval=$with_aix_soname; case "${host}:${enable_shared}" in +@@ -4999,7 +4999,7 @@ case ${host} in + # for hardware support. + powerpc*-*-linux*) + saved_CFLAGS="$CFLAGS" +- CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128" ++ CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128 -mfloat128-type" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PowerPC ISA 2.06 to build __float128 libraries" >&5 + $as_echo_n "checking for PowerPC ISA 2.06 to build __float128 libraries... " >&6; } + if test "${libgcc_cv_powerpc_float128+set}" = set; then : diff --git a/libgcc/configure.ac b/libgcc/configure.ac index af151473709..dada52416da 100644 --- a/libgcc/configure.ac
@@ -119,6 +499,15 @@ index af151473709..dada52416da 100644 AC_ARG_WITH(aix-soname, [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], [shared library versioning (aka "SONAME") variant to provide on AIX])], +@@ -394,7 +394,7 @@ case ${host} in + # for hardware support. + powerpc*-*-linux*) + saved_CFLAGS="$CFLAGS" +- CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128" ++ CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128 -mfloat128-type" + AC_CACHE_CHECK([for PowerPC ISA 2.06 to build __float128 libraries], + [libgcc_cv_powerpc_float128], + [AC_COMPILE_IFELSE( -- 2.12.2
meta/recipes-devtools/gcc/gcc-8.2/0034-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch +341 -1
355 lines not on this page · raw message
Signature · 1 line
2.7.4
Re: [PATCH 11/13] gcc: More places to patch to disable ldbl 128 for musl on PPC
Quoted 6 lines · Serhey Popovych
There are four functions using TFmode type (128bit) that isn't available when building with musl. Move each of them from common
ppc64-fp.cto individual files referenced from t-float128 that used when ldbl 128 enabled at configure time.
Quoted 7 lines
For gcc-7.3 if -mfloat128 is given -mfloat128-type must be given too.
Exclude
ibm-ldouble.cwhen ldbl 128 isn't enabled at config time.Build and boot tested with musl (no float128) and glibc (float128 and ibm128 on PowerPC64).
We should be dropping gcc 7 support in master for next release. Gcc 8 one is ok probably worth submitting it to gcc upstream as well.
Quoted 797 lines
Signed-off-by Serhey Popovych <[email protected]>--- ...44-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch | 391 ++++++++++++++++++++- ...34-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch | 342 +++++++++++++++++- 2 files changed, 731 insertions(+), 2 deletions(-)meta/recipes-devtools/gcc/gcc-7.3/0044-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch +390
-1@@ -36,14 +36,385 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux index 4f6d4c4a4d2..c50dd94a2da 100644 --- a/libgcc/config/rs6000/t-linux +++ b/libgcc/config/rs6000/t-linux -@@ -1,3 +1,6 @@ +@@ -1,3 +1,9 @@ SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver -HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc +ifeq ($(with_ldbl128),yes) +HOST_LIBGCC2_CFLAGS += -mlong-double-128 ++else ++# We do not want to build ibm-ldouble.c. ++LIB2ADD := $(filter-out %ibm-ldouble.c, $(LIB2ADD)) +endif +HOST_LIBGCC2_CFLAGS += -mno-minimal-toc +diff --git a/libgcc/config/rs6000/fixtfdi.c b/libgcc/config/rs6000/fixtfdi.c +new file mode 100644 +index 0000000..9b979d0 +--- /dev/null ++++ b/libgcc/config/rs6000/fixtfdi.c +@@ -0,0 +1,42 @@ ++/* Software floating-point emulation. ++ Convert a to 64bit signed integer ++ Copyright (C) 1997-2016 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Contributed by Richard Henderson ([email protected]) and ++ Jakub Jelinek ([email protected]). ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ In addition to the permissions in the GNU Lesser General Public ++ License, the Free Software Foundation gives you unlimited ++ permission to link the compiled version of this file into ++ combinations with other programs, and to distribute those ++ combinations without any restriction coming from the use of this ++ file. (The Lesser General Public License restrictions do apply in ++ other respects; for example, they cover modification of the file, ++ and distribution when not linked into a combine executable.) ++ ++ The GNU C Library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ <http://www.gnu.org/licenses/>. */ ++ ++#ifdef _ARCH_PPC64 ++#include "soft-fp.h" ++#include "quad-float128.h" ++ ++DItype ++__fixtfdi (TFtype a) ++{ ++ if (a < 0) ++ return - __fixunstfdi (-a); ++ return __fixunstfdi (a); ++} ++#endif +diff --git a/libgcc/config/rs6000/fixunstfdi.c b/libgcc/config/rs6000/fixunstfdi.c +new file mode 100644 +index 0000000..65e9590 +--- /dev/null ++++ b/libgcc/config/rs6000/fixunstfdi.c +@@ -0,0 +1,58 @@ ++/* Software floating-point emulation. ++ Convert a to 64bit unsigned integer ++ Copyright (C) 1997-2016 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Contributed by Richard Henderson ([email protected]) and ++ Jakub Jelinek ([email protected]). ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ In addition to the permissions in the GNU Lesser General Public ++ License, the Free Software Foundation gives you unlimited ++ permission to link the compiled version of this file into ++ combinations with other programs, and to distribute those ++ combinations without any restriction coming from the use of this ++ file. (The Lesser General Public License restrictions do apply in ++ other respects; for example, they cover modification of the file, ++ and distribution when not linked into a combine executable.) ++ ++ The GNU C Library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ <http://www.gnu.org/licenses/>. */ ++ ++#ifdef _ARCH_PPC64 ++#include "soft-fp.h" ++#include "quad-float128.h" ++ ++DItype ++__fixunstfdi (TFtype a) ++{ ++ if (a < 0) ++ return 0; ++ ++ /* Compute high word of result, as a flonum. */ ++ const TFtype b = (a / (((UDItype) 1) << (sizeof (SItype) * 8))); ++ /* Convert that to fixed (but not to DItype!), ++ and shift it into the high word. */ ++ UDItype v = (USItype) b; ++ v <<= (sizeof (SItype) * 8); ++ /* Remove high part from the TFtype, leaving the low part as flonum. */ ++ a -= (TFtype) v; ++ /* Convert that to fixed (but not to DItype!) and add it in. ++ Sometimes A comes out negative. This is significant, since ++ A has more bits than a long int does. */ ++ if (a < 0) ++ v -= (USItype) (-a); ++ else ++ v += (USItype) a; ++ return v; ++} ++#endif +diff --git a/libgcc/config/rs6000/floatditf.c b/libgcc/config/rs6000/floatditf.c +new file mode 100644 +index 0000000..20ad4c6 +--- /dev/null ++++ b/libgcc/config/rs6000/floatditf.c +@@ -0,0 +1,47 @@ ++/* Software floating-point emulation. ++ Convert a 64bit signed integer to IEEE quad ++ Copyright (C) 1997-2016 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Contributed by Richard Henderson ([email protected]) and ++ Jakub Jelinek ([email protected]). ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ In addition to the permissions in the GNU Lesser General Public ++ License, the Free Software Foundation gives you unlimited ++ permission to link the compiled version of this file into ++ combinations with other programs, and to distribute those ++ combinations without any restriction coming from the use of this ++ file. (The Lesser General Public License restrictions do apply in ++ other respects; for example, they cover modification of the file, ++ and distribution when not linked into a combine executable.) ++ ++ The GNU C Library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ <http://www.gnu.org/licenses/>. */ ++ ++#ifdef _ARCH_PPC64 ++#include "soft-fp.h" ++#include "double.h" ++#include "quad-float128.h" ++ ++TFtype ++__floatditf (DItype u) ++{ ++ DFtype dh, dl; ++ ++ dh = (SItype) (u >> (sizeof (SItype) * 8)); ++ dh *= 2.0 * (((UDItype) 1) << ((sizeof (SItype) * 8) - 1)); ++ dl = (USItype) (u & ((((UDItype) 1) << (sizeof (SItype) * 8)) - 1)); ++ ++ return (TFtype) dh + (TFtype) dl; ++} ++#endif +diff --git a/libgcc/config/rs6000/floatunditf.c b/libgcc/config/rs6000/floatunditf.c +new file mode 100644 +index 0000000..23dbde2 +--- /dev/null ++++ b/libgcc/config/rs6000/floatunditf.c +@@ -0,0 +1,47 @@ ++/* Software floating-point emulation. ++ Convert a 64bit unsigned integer to IEEE quad ++ Copyright (C) 1997-2016 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Contributed by Richard Henderson ([email protected]) and ++ Jakub Jelinek ([email protected]). ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ In addition to the permissions in the GNU Lesser General Public ++ License, the Free Software Foundation gives you unlimited ++ permission to link the compiled version of this file into ++ combinations with other programs, and to distribute those ++ combinations without any restriction coming from the use of this ++ file. (The Lesser General Public License restrictions do apply in ++ other respects; for example, they cover modification of the file, ++ and distribution when not linked into a combine executable.) ++ ++ The GNU C Library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ <http://www.gnu.org/licenses/>. */ ++ ++#ifdef _ARCH_PPC64 ++#include "soft-fp.h" ++#include "double.h" ++#include "quad-float128.h" ++ ++TFtype ++__floatunditf (UDItype u) ++{ ++ DFtype dh, dl; ++ ++ dh = (USItype) (u >> (sizeof (SItype) * 8)); ++ dh *= 2.0 * (((UDItype) 1) << ((sizeof (SItype) * 8) - 1)); ++ dl = (USItype) (u & ((((UDItype) 1) << (sizeof (SItype) * 8)) - 1)); ++ ++ return (TFtype) dh + (TFtype) dl; ++} ++#endif +diff --git a/libgcc/config/rs6000/ppc64-fp.c b/libgcc/config/rs6000/ppc64-fp.c +index 5e1cbdd..70ad3c9 100644 +--- a/libgcc/config/rs6000/ppc64-fp.c ++++ b/libgcc/config/rs6000/ppc64-fp.c +@@ -25,33 +25,20 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + <http://www.gnu.org/licenses/>. */ + + #if defined(__powerpc64__) || defined (__64BIT__) || defined(__ppc64__) +-#define TMODES + #include "fp-bit.h" + +-extern DItype __fixtfdi (TFtype); + extern DItype __fixdfdi (DFtype); + extern DItype __fixsfdi (SFtype); + extern USItype __fixunsdfsi (DFtype); + extern USItype __fixunssfsi (SFtype); +-extern TFtype __floatditf (DItype); +-extern TFtype __floatunditf (UDItype); + extern DFtype __floatdidf (DItype); + extern DFtype __floatundidf (UDItype); + extern SFtype __floatdisf (DItype); + extern SFtype __floatundisf (UDItype); +-extern DItype __fixunstfdi (TFtype); + + static DItype local_fixunssfdi (SFtype); + static DItype local_fixunsdfdi (DFtype); + +-DItype +-__fixtfdi (TFtype a) +-{ +- if (a < 0) +- return - __fixunstfdi (-a); +- return __fixunstfdi (a); +-} +- + DItype + __fixdfdi (DFtype a) + { +@@ -86,30 +73,6 @@ __fixunssfsi (SFtype a) + return (SItype) a; + } + +-TFtype +-__floatditf (DItype u) +-{ +- DFtype dh, dl; +- +- dh = (SItype) (u >> (sizeof (SItype) * 8)); +- dh *= 2.0 * (((UDItype) 1) << ((sizeof (SItype) * 8) - 1)); +- dl = (USItype) (u & ((((UDItype) 1) << (sizeof (SItype) * 8)) - 1)); +- +- return (TFtype) dh + (TFtype) dl; +-} +- +-TFtype +-__floatunditf (UDItype u) +-{ +- DFtype dh, dl; +- +- dh = (USItype) (u >> (sizeof (SItype) * 8)); +- dh *= 2.0 * (((UDItype) 1) << ((sizeof (SItype) * 8) - 1)); +- dl = (USItype) (u & ((((UDItype) 1) << (sizeof (SItype) * 8)) - 1)); +- +- return (TFtype) dh + (TFtype) dl; +-} +- + DFtype + __floatdidf (DItype u) + { +@@ -183,30 +146,6 @@ __floatundisf (UDItype u) + return (SFtype) f; + } + +-DItype +-__fixunstfdi (TFtype a) +-{ +- if (a < 0) +- return 0; +- +- /* Compute high word of result, as a flonum. */ +- const TFtype b = (a / (((UDItype) 1) << (sizeof (SItype) * 8))); +- /* Convert that to fixed (but not to DItype!), +- and shift it into the high word. */ +- UDItype v = (USItype) b; +- v <<= (sizeof (SItype) * 8); +- /* Remove high part from the TFtype, leaving the low part as flonum. */ +- a -= (TFtype) v; +- /* Convert that to fixed (but not to DItype!) and add it in. +- Sometimes A comes out negative. This is significant, since +- A has more bits than a long int does. */ +- if (a < 0) +- v -= (USItype) (-a); +- else +- v += (USItype) a; +- return v; +-} +- + /* This version is needed to prevent recursion; fixunsdfdi in libgcc + calls fixdfdi, which in turn calls calls fixunsdfdi. */ + +diff --git a/libgcc/config/rs6000/quad-float128.h b/libgcc/config/rs6000/quad-float128.h +index 7d69c87..a0c2664 100644 +--- a/libgcc/config/rs6000/quad-float128.h ++++ b/libgcc/config/rs6000/quad-float128.h +@@ -99,6 +99,11 @@ extern TItype_ppc __fixkfti (TFtype); + extern UTItype_ppc __fixunskfti (TFtype); + extern TFtype __floattikf (TItype_ppc); + extern TFtype __floatuntikf (UTItype_ppc); ++ ++extern DItype_ppc __fixtfdi (TFtype); ++extern DItype_ppc __fixunstfdi (TFtype); ++extern TFtype __floatditf (DItype_ppc); ++extern TFtype __floatunditf (UDItype_ppc); + #endif + + /* Functions using the ISA 3.0 hardware support. If the code is compiled with +diff --git a/libgcc/config/rs6000/t-float128 b/libgcc/config/rs6000/t-float128 +index 2c52ca6..3a241aa 100644 +--- a/libgcc/config/rs6000/t-float128 ++++ b/libgcc/config/rs6000/t-float128 +@@ -24,6 +24,7 @@ fp128_softfp_obj = $(fp128_softfp_static_obj) $(fp128_softfp_shared_obj) + + # New functions for software emulation + fp128_ppc_funcs = floattikf floatuntikf fixkfti fixunskfti \ ++ floatditf floatunditf fixtfdi fixunstfdi \ + extendkftf2-sw trunctfkf2-sw \ + sfp-exceptions _mulkc3 _divkc3 + +@@ -58,7 +59,7 @@ fp128_includes = $(srcdir)/soft-fp/double.h \ + $(srcdir)/soft-fp/soft-fp.h + + # Build the emulator without ISA 3.0 hardware support. +-FP128_CFLAGS_SW = -Wno-type-limits -mvsx -mfloat128 \ ++FP128_CFLAGS_SW = -Wno-type-limits -mvsx -mfloat128 -mfloat128-type \ + -mno-float128-hardware \ + -I$(srcdir)/soft-fp \ + -I$(srcdir)/config/rs6000 \ +diff --git a/libgcc/config/rs6000/t-float128-hw b/libgcc/config/rs6000/t-float128-hw +index 161062f..0476874 100644 +--- a/libgcc/config/rs6000/t-float128-hw ++++ b/libgcc/config/rs6000/t-float128-hw +@@ -21,7 +21,7 @@ fp128_ifunc_obj = $(fp128_ifunc_static_obj) $(fp128_ifunc_shared_obj) + fp128_sed_hw = -hw + + # Build the hardware support functions with appropriate hardware support +-FP128_CFLAGS_HW = -Wno-type-limits -mvsx -mfloat128 \ ++FP128_CFLAGS_HW = -Wno-type-limits -mvsx -mfloat128 -mfloat128-type \ + -mpower8-vector -mpower9-vector \ + -mfloat128-hardware \ + -I$(srcdir)/soft-fp \ diff --git a/libgcc/configure b/libgcc/configure old mode 100644 new mode 100755@@ -96,6 +467,15 @@ index 45c459788c3..e2d19b144b8 # Check whether --with-aix-soname was given. if test "${with_aix_soname+set}" = set; then : withval=$with_aix_soname; case "${host}:${enable_shared}" in +@@ -4999,7 +4999,7 @@ case ${host} in + # for hardware support. + powerpc*-*-linux*) + saved_CFLAGS="$CFLAGS" +- CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128" ++ CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128 -mfloat128-type" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PowerPC ISA 2.06 to build __float128 libraries" >&5 + $as_echo_n "checking for PowerPC ISA 2.06 to build __float128 libraries... " >&6; } + if test "${libgcc_cv_powerpc_float128+set}" = set; then : diff --git a/libgcc/configure.ac b/libgcc/configure.ac index af151473709..dada52416da 100644 --- a/libgcc/configure.ac@@ -119,6 +499,15 @@ index af151473709..dada52416da 100644 AC_ARG_WITH(aix-soname, [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], [shared library versioning (aka "SONAME") variant to provide on AIX])], +@@ -394,7 +394,7 @@ case ${host} in + # for hardware support. + powerpc*-*-linux*) + saved_CFLAGS="$CFLAGS" +- CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128" ++ CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128 -mfloat128-type" + AC_CACHE_CHECK([for PowerPC ISA 2.06 to build __float128 libraries], + [libgcc_cv_powerpc_float128], + [AC_COMPILE_IFELSE( -- 2.12.2meta/recipes-devtools/gcc/gcc-8.2/0034-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch +341
-2@@ -37,14 +37,354 @@ diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux index 4f6d4c4a4d2..c50dd94a2da 100644 --- a/libgcc/config/rs6000/t-linux +++ b/libgcc/config/rs6000/t-linux -@@ -1,3 +1,6 @@ +@@ -1,3 +1,9 @@ SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver -HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc +ifeq ($(with_ldbl128),yes) +HOST_LIBGCC2_CFLAGS += -mlong-double-128 ++else ++# We do not want to build ibm-ldouble.c. ++LIB2ADD := $(filter-out %ibm-ldouble.c, $(LIB2ADD)) +endif +HOST_LIBGCC2_CFLAGS += -mno-minimal-toc +diff --git a/libgcc/config/rs6000/fixtfdi.c b/libgcc/config/rs6000/fixtfdi.c +--- a/libgcc/config/rs6000/fixtfdi.c 1969-12-31 19:00:00.000000000 -0500 ++++ b/libgcc/config/rs6000/fixtfdi.c 2018-12-12 17:54:50.110755540 -0500 +@@ -0,0 +1,42 @@ ++/* Software floating-point emulation. ++ Convert a to 64bit signed integer ++ Copyright (C) 1997-2016 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Contributed by Richard Henderson ([email protected]) and ++ Jakub Jelinek ([email protected]). ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ In addition to the permissions in the GNU Lesser General Public ++ License, the Free Software Foundation gives you unlimited ++ permission to link the compiled version of this file into ++ combinations with other programs, and to distribute those ++ combinations without any restriction coming from the use of this ++ file. (The Lesser General Public License restrictions do apply in ++ other respects; for example, they cover modification of the file, ++ and distribution when not linked into a combine executable.) ++ ++ The GNU C Library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ <http://www.gnu.org/licenses/>. */ ++ ++#ifdef _ARCH_PPC64 ++#include "soft-fp.h" ++#include "quad-float128.h" ++ ++DItype ++__fixtfdi (TFtype a) ++{ ++ if (a < 0) ++ return - __fixunstfdi (-a); ++ return __fixunstfdi (a); ++} ++#endif +diff --git a/libgcc/config/rs6000/fixunstfdi.c b/libgcc/config/rs6000/fixunstfdi.c +--- a/libgcc/config/rs6000/fixunstfdi.c 1969-12-31 19:00:00.000000000 -0500 ++++ b/libgcc/config/rs6000/fixunstfdi.c 2018-12-12 17:56:06.141654537 -0500 +@@ -0,0 +1,58 @@ ++/* Software floating-point emulation. ++ Convert a to 64bit unsigned integer ++ Copyright (C) 1997-2016 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Contributed by Richard Henderson ([email protected]) and ++ Jakub Jelinek ([email protected]). ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ In addition to the permissions in the GNU Lesser General Public ++ License, the Free Software Foundation gives you unlimited ++ permission to link the compiled version of this file into ++ combinations with other programs, and to distribute those ++ combinations without any restriction coming from the use of this ++ file. (The Lesser General Public License restrictions do apply in ++ other respects; for example, they cover modification of the file, ++ and distribution when not linked into a combine executable.) ++ ++ The GNU C Library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ <http://www.gnu.org/licenses/>. */ ++ ++#ifdef _ARCH_PPC64 ++#include "soft-fp.h" ++#include "quad-float128.h" ++ ++DItype ++__fixunstfdi (TFtype a) ++{ ++ if (a < 0) ++ return 0; ++ ++ /* Compute high word of result, as a flonum. */ ++ const TFtype b = (a / (((UDItype) 1) << (sizeof (SItype) * 8))); ++ /* Convert that to fixed (but not to DItype!), ++ and shift it into the high word. */ ++ UDItype v = (USItype) b; ++ v <<= (sizeof (SItype) * 8); ++ /* Remove high part from the TFtype, leaving the low part as flonum. */ ++ a -= (TFtype) v; ++ /* Convert that to fixed (but not to DItype!) and add it in. ++ Sometimes A comes out negative. This is significant, since ++ A has more bits than a long int does. */ ++ if (a < 0) ++ v -= (USItype) (-a); ++ else ++ v += (USItype) a; ++ return v; ++} ++#endif +diff --git a/libgcc/config/rs6000/floatditf.c b/libgcc/config/rs6000/floatditf.c +--- a/libgcc/config/rs6000/floatditf.c 1969-12-31 19:00:00.000000000 -0500 ++++ b/libgcc/config/rs6000/floatditf.c 2018-12-12 17:57:55.852953553 -0500 +@@ -0,0 +1,47 @@ ++/* Software floating-point emulation. ++ Convert a 64bit signed integer to IEEE quad ++ Copyright (C) 1997-2016 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Contributed by Richard Henderson ([email protected]) and ++ Jakub Jelinek ([email protected]). ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ In addition to the permissions in the GNU Lesser General Public ++ License, the Free Software Foundation gives you unlimited ++ permission to link the compiled version of this file into ++ combinations with other programs, and to distribute those ++ combinations without any restriction coming from the use of this ++ file. (The Lesser General Public License restrictions do apply in ++ other respects; for example, they cover modification of the file, ++ and distribution when not linked into a combine executable.) ++ ++ The GNU C Library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ <http://www.gnu.org/licenses/>. */ ++ ++#ifdef _ARCH_PPC64 ++#include "soft-fp.h" ++#include "double.h" ++#include "quad-float128.h" ++ ++TFtype ++__floatditf (DItype u) ++{ ++ DFtype dh, dl; ++ ++ dh = (SItype) (u >> (sizeof (SItype) * 8)); ++ dh *= 2.0 * (((UDItype) 1) << ((sizeof (SItype) * 8) - 1)); ++ dl = (USItype) (u & ((((UDItype) 1) << (sizeof (SItype) * 8)) - 1)); ++ ++ return (TFtype) dh + (TFtype) dl; ++} ++#endif +diff --git a/libgcc/config/rs6000/floatunditf.c b/libgcc/config/rs6000/floatunditf.c +--- a/libgcc/config/rs6000/floatunditf.c 1969-12-31 19:00:00.000000000 -0500 ++++ b/libgcc/config/rs6000/floatunditf.c 2018-12-12 17:57:15.262473574 -0500 +@@ -0,0 +1,47 @@ ++/* Software floating-point emulation. ++ Convert a 64bit unsigned integer to IEEE quad ++ Copyright (C) 1997-2016 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Contributed by Richard Henderson ([email protected]) and ++ Jakub Jelinek ([email protected]). ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ In addition to the permissions in the GNU Lesser General Public ++ License, the Free Software Foundation gives you unlimited ++ permission to link the compiled version of this file into ++ combinations with other programs, and to distribute those ++ combinations without any restriction coming from the use of this ++ file. (The Lesser General Public License restrictions do apply in ++ other respects; for example, they cover modification of the file, ++ and distribution when not linked into a combine executable.) ++ ++ The GNU C Library 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 ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ <http://www.gnu.org/licenses/>. */ ++ ++#ifdef _ARCH_PPC64 ++#include "soft-fp.h" ++#include "double.h" ++#include "quad-float128.h" ++ ++TFtype ++__floatunditf (UDItype u) ++{ ++ DFtype dh, dl; ++ ++ dh = (USItype) (u >> (sizeof (SItype) * 8)); ++ dh *= 2.0 * (((UDItype) 1) << ((sizeof (SItype) * 8) - 1)); ++ dl = (USItype) (u & ((((UDItype) 1) << (sizeof (SItype) * 8)) - 1)); ++ ++ return (TFtype) dh + (TFtype) dl; ++} ++#endif +diff --git a/libgcc/config/rs6000/ppc64-fp.c b/libgcc/config/rs6000/ppc64-fp.c +--- a/libgcc/config/rs6000/ppc64-fp.c 2018-12-12 17:53:49.540038500 -0500 ++++ b/libgcc/config/rs6000/ppc64-fp.c 2018-12-12 17:49:51.897235314 -0500 +@@ -25,34 +25,21 @@ + <http://www.gnu.org/licenses/>. */ + + #if defined(__powerpc64__) || defined (__64BIT__) || defined(__ppc64__) +-#define TMODES + #include "fp-bit.h" + +-extern DItype __fixtfdi (TFtype); + extern DItype __fixdfdi (DFtype); + extern DItype __fixsfdi (SFtype); + extern USItype __fixunsdfsi (DFtype); + extern USItype __fixunssfsi (SFtype); +-extern TFtype __floatditf (DItype); +-extern TFtype __floatunditf (UDItype); + extern DFtype __floatdidf (DItype); + extern DFtype __floatundidf (UDItype); + extern SFtype __floatdisf (DItype); + extern SFtype __floatundisf (UDItype); +-extern DItype __fixunstfdi (TFtype); + + static DItype local_fixunssfdi (SFtype); + static DItype local_fixunsdfdi (DFtype); + + DItype +-__fixtfdi (TFtype a) +-{ +- if (a < 0) +- return - __fixunstfdi (-a); +- return __fixunstfdi (a); +-} +- +-DItype + __fixdfdi (DFtype a) + { + if (a < 0) +@@ -86,30 +73,6 @@ + return (SItype) a; + } + +-TFtype +-__floatditf (DItype u) +-{ +- DFtype dh, dl; +- +- dh = (SItype) (u >> (sizeof (SItype) * 8)); +- dh *= 2.0 * (((UDItype) 1) << ((sizeof (SItype) * 8) - 1)); +- dl = (USItype) (u & ((((UDItype) 1) << (sizeof (SItype) * 8)) - 1)); +- +- return (TFtype) dh + (TFtype) dl; +-} +- +-TFtype +-__floatunditf (UDItype u) +-{ +- DFtype dh, dl; +- +- dh = (USItype) (u >> (sizeof (SItype) * 8)); +- dh *= 2.0 * (((UDItype) 1) << ((sizeof (SItype) * 8) - 1)); +- dl = (USItype) (u & ((((UDItype) 1) << (sizeof (SItype) * 8)) - 1)); +- +- return (TFtype) dh + (TFtype) dl; +-} +- + DFtype + __floatdidf (DItype u) + { +@@ -183,30 +146,6 @@ + return (SFtype) f; + } + +-DItype +-__fixunstfdi (TFtype a) +-{ +- if (a < 0) +- return 0; +- +- /* Compute high word of result, as a flonum. */ +- const TFtype b = (a / (((UDItype) 1) << (sizeof (SItype) * 8))); +- /* Convert that to fixed (but not to DItype!), +- and shift it into the high word. */ +- UDItype v = (USItype) b; +- v <<= (sizeof (SItype) * 8); +- /* Remove high part from the TFtype, leaving the low part as flonum. */ +- a -= (TFtype) v; +- /* Convert that to fixed (but not to DItype!) and add it in. +- Sometimes A comes out negative. This is significant, since +- A has more bits than a long int does. */ +- if (a < 0) +- v -= (USItype) (-a); +- else +- v += (USItype) a; +- return v; +-} +- + /* This version is needed to prevent recursion; fixunsdfdi in libgcc + calls fixdfdi, which in turn calls calls fixunsdfdi. */ + +diff --git a/libgcc/config/rs6000/quad-float128.h b/libgcc/config/rs6000/quad-float128.h +--- a/libgcc/config/rs6000/quad-float128.h 2018-12-12 17:53:49.540038500 -0500 ++++ b/libgcc/config/rs6000/quad-float128.h 2018-12-12 17:30:19.423468244 -0500 +@@ -104,6 +104,11 @@ + extern UTItype_ppc __fixunskfti (TFtype); + extern TFtype __floattikf (TItype_ppc); + extern TFtype __floatuntikf (UTItype_ppc); ++ ++extern DItype_ppc __fixtfdi (TFtype); ++extern DItype_ppc __fixunstfdi (TFtype); ++extern TFtype __floatditf (DItype_ppc); ++extern TFtype __floatunditf (UDItype_ppc); + #endif + + /* Functions using the ISA 3.0 hardware support. If the code is compiled with +diff --git a/libgcc/config/rs6000/t-float128 b/libgcc/config/rs6000/t-float128 +--- a/libgcc/config/rs6000/t-float128 2018-12-12 17:53:49.540038500 -0500 ++++ b/libgcc/config/rs6000/t-float128 2018-12-12 17:45:12.233937136 -0500 +@@ -24,6 +24,7 @@ + + # New functions for software emulation + fp128_ppc_funcs = floattikf floatuntikf fixkfti fixunskfti \ ++ floatditf floatunditf fixtfdi fixunstfdi \ + extendkftf2-sw trunctfkf2-sw \ + sfp-exceptions _mulkc3 _divkc3 _powikf2 + + diff --git a/libgcc/configure b/libgcc/configure old mode 100644 new mode 100755 --2.7.4
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Re: [PATCH 11/13] gcc: More places to patch to disable ldbl 128 for musl on PPC
Quoted 12 lines · Khem Raj
Quoted 10 lines · Serhey Popovych
There are four functions using TFmode type (128bit) that isn't available when building with musl. Move each of them from common
ppc64-fp.cto individual files referenced from t-float128 that used when ldbl 128 enabled at configure time.For gcc-7.3 if -mfloat128 is given -mfloat128-type must be given too.
Exclude
ibm-ldouble.cwhen ldbl 128 isn't enabled at config time.
Quoted 7 lines
Quoted 3 lines
Build and boot tested with musl (no float128) and glibc (float128 and ibm128 on PowerPC64).
We should be dropping gcc 7 support in master for next release. Gcc 8 one is ok
probably worth submitting it to gcc upstream as well.
I'll probably merge the series and then remove gcc7...
Cheers,
Richard
PATCH 12/13 gcc: Enable secureplt for powerpc64 target too
In reply to Serhey Popovych--- meta/recipes-devtools/gcc/gcc-common.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-devtools/gcc/gcc-common.inc +1 -1
@@ -38,7 +38,7 @@ def get_gcc_mips_plt_setting(bb, d): return "" def get_gcc_ppc_plt_settings(bb, d): - if d.getVar('TRANSLATED_TARGET_ARCH') in [ 'powerpc' ] and not bb.utils.contains('DISTRO_FEATURES', 'bssplt', True, False, d): + if d.getVar('TRANSLATED_TARGET_ARCH') in [ 'powerpc', 'powerpc64' ] and not bb.utils.contains('DISTRO_FEATURES', 'bssplt', True, False, d): return "--enable-secureplt" return ""
Signature · 1 line
2.7.4
PATCH 13/13 gcc-7.3, gcc-8.2: Use variable SYSTEMLIBS_DIR instead of hardcoding it for ppc64
In reply to Serhey Popovych--- meta/recipes-devtools/gcc/gcc-7.3.inc | 1 + ...werpc-powerpc64-Add-support-for-musl-ldso.patch | 31 ++++++++++++++++++++++ meta/recipes-devtools/gcc/gcc-8.2.inc | 1 + ...werpc-powerpc64-Add-support-for-musl-ldso.patch | 31 ++++++++++++++++++++++ 4 files changed, 64 insertions(+) create mode 100644 meta/recipes-devtools/gcc/gcc-7.3/0050-powerpc-powerpc64-Add-support-for-musl-ldso.patch create mode 100644 meta/recipes-devtools/gcc/gcc-8.2/0042-powerpc-powerpc64-Add-support-for-musl-ldso.patch
meta/recipes-devtools/gcc/gcc-7.3.inc +1 -0
@@ -72,6 +72,7 @@ SRC_URI = "\ file://0047-sync-gcc-stddef.h-with-musl.patch \ file://0048-gcc-Enable-static-PIE.patch \ file://0049-gcc-override-TARGET_LIBC_PROVIDES_SSP.patch \ + file://0050-powerpc-powerpc64-Add-support-for-musl-ldso.patch \ file://fix-segmentation-fault-precompiled-hdr.patch \ file://no-sse-fix-test-case-failures.patch \ ${BACKPORTS} \
meta/recipes-devtools/gcc/gcc-7.3/0050-powerpc-powerpc64-Add-support-for-musl-ldso.patch new file +31 -0
@@ -0,0 +1,31 @@ +From 3f5f5da776be86b408a15f38c9782f2185f97073 Mon Sep 17 00:00:00 2001 +From: Serhey Popovych <[email protected]> +Date: Tue, 11 Dec 2018 02:30:50 -0500 +Subject: [PATCH] powerpc/powerpc64: Add support for musl ldso + +Signed-off-by: Serhey Popovych <[email protected]> +--- +Upstream-Status: Inappropriate [OE-Specific] + + gcc/config/rs6000/linux64.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h +index 619e113..ee8b44f 100644 +--- a/gcc/config/rs6000/linux64.h ++++ b/gcc/config/rs6000/linux64.h +@@ -421,9 +421,9 @@ extern int dot_symbols; + #endif + + #define MUSL_DYNAMIC_LINKER32 \ +- "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1" ++ SYSTEMLIBS_DIR "ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1" + #define MUSL_DYNAMIC_LINKER64 \ +- "/lib/ld-musl-powerpc64" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1" ++ SYSTEMLIBS_DIR "ld-musl-powerpc64" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1" + + #define UCLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-uClibc.so.0" + #define UCLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld64-uClibc.so.0" +-- +2.7.4 +
meta/recipes-devtools/gcc/gcc-8.2.inc +1 -0
@@ -70,6 +70,7 @@ SRC_URI = "\ file://0039-Fix-for-testsuite-failure.patch \ file://0040-Re-introduce-spe-commandline-options.patch \ file://0041-ARC-fix-spec-gen.patch \ + file://0042-powerpc-powerpc64-Add-support-for-musl-ldso.patch \ ${BACKPORTS} \ " BACKPORTS = "\
meta/recipes-devtools/gcc/gcc-8.2/0042-powerpc-powerpc64-Add-support-for-musl-ldso.patch new file +31 -0
@@ -0,0 +1,31 @@ +From 3f5f5da776be86b408a15f38c9782f2185f97073 Mon Sep 17 00:00:00 2001 +From: Serhey Popovych <[email protected]> +Date: Tue, 11 Dec 2018 02:30:50 -0500 +Subject: [PATCH] powerpc/powerpc64: Add support for musl ldso + +Signed-off-by: Serhey Popovych <[email protected]> +--- +Upstream-Status: Inappropriate [OE-Specific] + + gcc/config/rs6000/linux64.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h +index 619e113..ee8b44f 100644 +--- a/gcc/config/rs6000/linux64.h ++++ b/gcc/config/rs6000/linux64.h +@@ -421,9 +421,9 @@ extern int dot_symbols; + #endif + + #define MUSL_DYNAMIC_LINKER32 \ +- "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1" ++ SYSTEMLIBS_DIR "ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1" + #define MUSL_DYNAMIC_LINKER64 \ +- "/lib/ld-musl-powerpc64" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1" ++ SYSTEMLIBS_DIR "ld-musl-powerpc64" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1" + + #define UCLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-uClibc.so.0" + #define UCLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld64-uClibc.so.0" +-- +2.7.4 +
Signature · 1 line
2.7.4
Serhey
Thanks for doing this work and really a clean pull request with good explanation that I have seen lately. Good work, For most parts everything is in order except few places where I have replied specifically to the patches
Quoted 110 lines · Serhey Popovych
Musl has support for ppc (32bit) and ppc64 (64bit). OE still missing several tricks in configuration to make builds possible:
1) Most important part is that musl implements elfv2 ABI only for 64bit PowerPC. That ABI is default for little-endian but supports big-endian too. Historically elfv1 ABI is used for big-endian PowerPC.
2) Using uncommon elfv2 ABI for big-endian requires to disable all assembler optimizations in openssl: unfortunately I can't find more smart way at the moment.
3) LDSO path need to be adjusted to support /lib64 path which is default for powerpc64 (see bitbake.conf) instead of $baselibdir.
4) Default library search path is hardcoded to "/lib:/usr/local/lib:/usr/lib": pass -DSYSLIBDIR and -DLIBDIR and use them to set path.
5) Need to add more tweaks to patch that adds --with-ldbl-128 knob to gcc configure: there is a set of functions that use TFtype in
ppc64-fp.cin libgcc. This should be compatible with glibc.6) Disable qemu-userspace for powerpc64 bit: there is no support. While there change qemuwrapper to exit explicitly to fix infinite execution in
do_rootfs()task when building on IBM POWER8 machine.7) Misc fixes that map powerpc-linux-musl python3 triplet to powerpc-linux-gnu, remove conflicting sed in
do_configure()vs patch settings in gcc and fix DEFAULTTUNE settings for various IBM POWER platforms.Build is done on IBM POWER8 machine running RHEL7:
Images:
-------
core-image-sato
core-image-full-cmdlineFor powerpc64:
--------------
glibc musl
systemd sysvinit systemd sysvinitgcc-7.3 y y y y gcc-8.2 y y y yFor powerpc:
------------
glibc musl
systemd sysvinit systemd sysvinitgcc-7.3 n x x x (*) gcc-8.2 y y y yNote that gcc-7.3 builds for 32bit powerpc fail due to:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=11754Kernel/images are boot tested using KVM-HV on IBM POWER8.
Serhey Popovych (13):
lib/oe/elf.py: Add powerpc64 architecture definition for musl tune-power[5-7].inc: Fix DEFAULTTUNE values tune-power[5-7].inc: Disable QEMU usermode usage
qemuwrapper: Explicitly exit in case of no qemu supported for target arch-powerpc64.inc: Use elfv2 ABI when building with musl
musl: Create default library search path based on configuration
musl: EnsureGLIBC_LDSOsymlink target does not exist on reinstall
openssl: Skip assembler optimized code for powerpc64 with musl
python3: Fixdo_configurecheck platform triplet error (2)
gcc: Fix preprocessor redefines for header pathes
gcc: More places to patch to disable ldbl 128 for musl on PPC
gcc: Enable secureplt for powerpc64 target too gcc-7.3,gcc-8.2: Use variableSYSTEMLIBS_DIRinstead of hardcoding it
for ppc64.../machine/include/powerpc/arch-powerpc64.inc | 3 + meta/conf/machine/include/tune-power5.inc | 5 +- meta/conf/machine/include/tune-power6.inc | 5 +- meta/conf/machine/include/tune-power7.inc | 5 +- meta/lib/oe/elf.py | 1 + .../openssl/openssl10_1.0.2q.bb | 1 + .../recipes-connectivity/openssl/openssl_1.1.1a.bb | 1 + ...slibdir-and-libdir-as-default-pathes-to-l.patch | 61 ++++ meta/recipes-core/musl/musl_git.bb | 3 +- meta/recipes-devtools/gcc/gcc-7.3.inc | 1 + ...Ensure-target-gcc-headers-can-be-included.patch | 36 -- ...44-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch | 391 ++++++++++++++++++++- ...werpc-powerpc64-Add-support-for-musl-ldso.patch | 31 ++ meta/recipes-devtools/gcc/gcc-8.2.inc | 1 + ...Ensure-target-gcc-headers-can-be-included.patch | 36 -- ...34-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch | 342 +++++++++++++++++- ...werpc-powerpc64-Add-support-for-musl-ldso.patch | 31 ++ meta/recipes-devtools/gcc/gcc-common.inc | 2 +- .../tweak-MULTIARCH-for-powerpc-linux-musl.patch | 40 +++ meta/recipes-devtools/python/python3_3.5.6.bb | 1 + .../recipes-devtools/qemu/qemuwrapper-cross_1.0.bb | 3 +- 21 files changed, 920 insertions(+), 80 deletions(-) create mode 100644 meta/recipes-core/musl/musl/0002-ldso-Use-syslibdir-and-libdir-as-default-pathes-to-l.patch create mode 100644 meta/recipes-devtools/gcc/gcc-7.3/0050-powerpc-powerpc64-Add-support-for-musl-ldso.patch create mode 100644 meta/recipes-devtools/gcc/gcc-8.2/0042-powerpc-powerpc64-Add-support-for-musl-ldso.patch create mode 100644 meta/recipes-devtools/python/python3/tweak-MULTIARCH-for-powerpc-linux-musl.patch--
2.7.4--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Quoted 6 lines · Khem Raj
Serhey
Thanks for doing this work and really a clean pull request with good explanation that I have seen lately. Good work, For most parts everything is in order except few places where I have replied specifically to the patches
Khem, thank you for quick review! I will try to address your comments with upstream even after this series already merged.
But at the moment I'm working on series intended to improve situation with ppc64le support (inluding musl).
There is more places to address. For example build w/o altivec support. Currently tune actually does nothing to avoid Altivec/VSX instructions in binary. This is however only may be a problem for some embedded stuff or very old POWER machines (i.e. before POWER6 I guess).
Quoted 113 lines
Quoted 110 lines · Serhey Popovych
Musl has support for ppc (32bit) and ppc64 (64bit). OE still missing several tricks in configuration to make builds possible:
1) Most important part is that musl implements elfv2 ABI only for 64bit PowerPC. That ABI is default for little-endian but supports big-endian too. Historically elfv1 ABI is used for big-endian PowerPC.
2) Using uncommon elfv2 ABI for big-endian requires to disable all assembler optimizations in openssl: unfortunately I can't find more smart way at the moment.
3) LDSO path need to be adjusted to support /lib64 path which is default for powerpc64 (see bitbake.conf) instead of $baselibdir.
4) Default library search path is hardcoded to "/lib:/usr/local/lib:/usr/lib": pass -DSYSLIBDIR and -DLIBDIR and use them to set path.
5) Need to add more tweaks to patch that adds --with-ldbl-128 knob to gcc configure: there is a set of functions that use TFtype in
ppc64-fp.cin libgcc. This should be compatible with glibc.6) Disable qemu-userspace for powerpc64 bit: there is no support. While there change qemuwrapper to exit explicitly to fix infinite execution in
do_rootfs()task when building on IBM POWER8 machine.7) Misc fixes that map powerpc-linux-musl python3 triplet to powerpc-linux-gnu, remove conflicting sed in
do_configure()vs patch settings in gcc and fix DEFAULTTUNE settings for various IBM POWER platforms.Build is done on IBM POWER8 machine running RHEL7:
Images:
-------
core-image-sato
core-image-full-cmdlineFor powerpc64:
--------------
glibc musl
systemd sysvinit systemd sysvinitgcc-7.3 y y y y gcc-8.2 y y y yFor powerpc:
------------
glibc musl
systemd sysvinit systemd sysvinitgcc-7.3 n x x x (*) gcc-8.2 y y y yNote that gcc-7.3 builds for 32bit powerpc fail due to:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=11754Kernel/images are boot tested using KVM-HV on IBM POWER8.
Serhey Popovych (13):
lib/oe/elf.py: Add powerpc64 architecture definition for musl tune-power[5-7].inc: Fix DEFAULTTUNE values tune-power[5-7].inc: Disable QEMU usermode usage
qemuwrapper: Explicitly exit in case of no qemu supported for target arch-powerpc64.inc: Use elfv2 ABI when building with musl
musl: Create default library search path based on configuration
musl: EnsureGLIBC_LDSOsymlink target does not exist on reinstall
openssl: Skip assembler optimized code for powerpc64 with musl
python3: Fixdo_configurecheck platform triplet error (2)
gcc: Fix preprocessor redefines for header pathes
gcc: More places to patch to disable ldbl 128 for musl on PPC
gcc: Enable secureplt for powerpc64 target too gcc-7.3,gcc-8.2: Use variableSYSTEMLIBS_DIRinstead of hardcoding it
for ppc64.../machine/include/powerpc/arch-powerpc64.inc | 3 + meta/conf/machine/include/tune-power5.inc | 5 +- meta/conf/machine/include/tune-power6.inc | 5 +- meta/conf/machine/include/tune-power7.inc | 5 +- meta/lib/oe/elf.py | 1 + .../openssl/openssl10_1.0.2q.bb | 1 + .../recipes-connectivity/openssl/openssl_1.1.1a.bb | 1 + ...slibdir-and-libdir-as-default-pathes-to-l.patch | 61 ++++ meta/recipes-core/musl/musl_git.bb | 3 +- meta/recipes-devtools/gcc/gcc-7.3.inc | 1 + ...Ensure-target-gcc-headers-can-be-included.patch | 36 -- ...44-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch | 391 ++++++++++++++++++++- ...werpc-powerpc64-Add-support-for-musl-ldso.patch | 31 ++ meta/recipes-devtools/gcc/gcc-8.2.inc | 1 + ...Ensure-target-gcc-headers-can-be-included.patch | 36 -- ...34-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch | 342 +++++++++++++++++- ...werpc-powerpc64-Add-support-for-musl-ldso.patch | 31 ++ meta/recipes-devtools/gcc/gcc-common.inc | 2 +- .../tweak-MULTIARCH-for-powerpc-linux-musl.patch | 40 +++ meta/recipes-devtools/python/python3_3.5.6.bb | 1 + .../recipes-devtools/qemu/qemuwrapper-cross_1.0.bb | 3 +- 21 files changed, 920 insertions(+), 80 deletions(-) create mode 100644 meta/recipes-core/musl/musl/0002-ldso-Use-syslibdir-and-libdir-as-default-pathes-to-l.patch create mode 100644 meta/recipes-devtools/gcc/gcc-7.3/0050-powerpc-powerpc64-Add-support-for-musl-ldso.patch create mode 100644 meta/recipes-devtools/gcc/gcc-8.2/0042-powerpc-powerpc64-Add-support-for-musl-ldso.patch create mode 100644 meta/recipes-devtools/python/python3/tweak-MULTIARCH-for-powerpc-linux-musl.patch--
2.7.4--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core