All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/6] glibc: Unify wordsize.h for arm and aarch64
@ 2020-05-16 15:58 Khem Raj
  2020-05-16 15:58 ` [PATCH 2/6] glibc: Do not synthesize wordsize.h for arm multilibs Khem Raj
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Khem Raj @ 2020-05-16 15:58 UTC (permalink / raw)
  To: openembedded-core; +Cc: Khem Raj

Should help simplify multilib in arm world

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...y-the-header-between-arm-and-aarch64.patch | 67 +++++++++++++++++++
 meta/recipes-core/glibc/glibc_2.31.bb         |  1 +
 2 files changed, 68 insertions(+)
 create mode 100644 meta/recipes-core/glibc/glibc/0030-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch

diff --git a/meta/recipes-core/glibc/glibc/0030-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch b/meta/recipes-core/glibc/glibc/0030-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch
new file mode 100644
index 0000000000..cbef2f2830
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0030-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch
@@ -0,0 +1,67 @@
+From 9cb0a756b017f5961b70ac781d3eaec6c82513cb Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 15 May 2020 17:05:45 -0700
+Subject: [PATCH] wordsize.h: Unify the header between arm and aarch64
+
+This helps OE multilibs to not sythesize this header which causes all
+kind of recursions and other issues since wordsize is fundamental header
+and ends up including itself in many case e.g. clang tidy, bpf etc.
+
+Upstream-Status: Inappropriate [ OE-Specific ]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/aarch64/bits/wordsize.h          | 8 ++++++--
+ sysdeps/{aarch64 => arm}/bits/wordsize.h | 8 ++++++--
+ 2 files changed, 12 insertions(+), 4 deletions(-)
+ copy sysdeps/{aarch64 => arm}/bits/wordsize.h (85%)
+
+diff --git a/sysdeps/aarch64/bits/wordsize.h b/sysdeps/aarch64/bits/wordsize.h
+index ee01841773..34fcdef1f1 100644
+--- a/sysdeps/aarch64/bits/wordsize.h
++++ b/sysdeps/aarch64/bits/wordsize.h
+@@ -17,12 +17,16 @@
+    License along with the GNU C Library; if not, see
+    <https://www.gnu.org/licenses/>.  */
+ 
+-#ifdef __LP64__
++#if defined (__aarch64__) && defined (__LP64__)
+ # define __WORDSIZE			64
+-#else
++#elif defined (__aarch64__)
+ # define __WORDSIZE			32
+ # define __WORDSIZE32_SIZE_ULONG	1
+ # define __WORDSIZE32_PTRDIFF_LONG	1
++#else
++# define __WORDSIZE			32
++# define __WORDSIZE32_SIZE_ULONG	0
++# define __WORDSIZE32_PTRDIFF_LONG	0
+ #endif
+ 
+ #define __WORDSIZE_TIME64_COMPAT32	0
+diff --git a/sysdeps/aarch64/bits/wordsize.h b/sysdeps/arm/bits/wordsize.h
+similarity index 85%
+copy from sysdeps/aarch64/bits/wordsize.h
+copy to sysdeps/arm/bits/wordsize.h
+index ee01841773..34fcdef1f1 100644
+--- a/sysdeps/aarch64/bits/wordsize.h
++++ b/sysdeps/arm/bits/wordsize.h
+@@ -17,12 +17,16 @@
+    License along with the GNU C Library; if not, see
+    <https://www.gnu.org/licenses/>.  */
+ 
+-#ifdef __LP64__
++#if defined (__aarch64__) && defined (__LP64__)
+ # define __WORDSIZE			64
+-#else
++#elif defined (__aarch64__)
+ # define __WORDSIZE			32
+ # define __WORDSIZE32_SIZE_ULONG	1
+ # define __WORDSIZE32_PTRDIFF_LONG	1
++#else
++# define __WORDSIZE			32
++# define __WORDSIZE32_SIZE_ULONG	0
++# define __WORDSIZE32_PTRDIFF_LONG	0
+ #endif
+ 
+ #define __WORDSIZE_TIME64_COMPAT32	0
diff --git a/meta/recipes-core/glibc/glibc_2.31.bb b/meta/recipes-core/glibc/glibc_2.31.bb
index 2032311b27..61679e2c1c 100644
--- a/meta/recipes-core/glibc/glibc_2.31.bb
+++ b/meta/recipes-core/glibc/glibc_2.31.bb
@@ -40,6 +40,7 @@ SRC_URI =  "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
            file://0027-intl-Emit-no-lines-in-bison-generated-files.patch \
            file://0028-inject-file-assembly-directives.patch \
            file://0029-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch \
+           file://0030-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch \
            "
 S = "${WORKDIR}/git"
 B = "${WORKDIR}/build-${TARGET_SYS}"
-- 
2.26.2


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

* [PATCH 2/6] glibc: Do not synthesize wordsize.h for arm multilibs
  2020-05-16 15:58 [PATCH 1/6] glibc: Unify wordsize.h for arm and aarch64 Khem Raj
@ 2020-05-16 15:58 ` Khem Raj
  2020-05-16 15:58 ` [PATCH 3/6] multilib_header_wrapper.h: Remove pragma once Khem Raj
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Khem Raj @ 2020-05-16 15:58 UTC (permalink / raw)
  To: openembedded-core; +Cc: Khem Raj

This has been constant source of trouble, because it is fundamental file
which sets machine word length and everything else builts on top of that
so when it is sythesized like this, where the sythesize template itself
needs wordsize.h to determine machine word length, it creates the
catch-22 problem, which is seen when building things like bpf, or
running clang-tidy etc. where compiler internal defines may not be used
this ends up in all sorts of problems. Now that glibc provides exact
same header for arm and aarch64, its no longer needed to be multilibbed
here

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/recipes-core/glibc/glibc-package.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-core/glibc/glibc-package.inc b/meta/recipes-core/glibc/glibc-package.inc
index 3e92ce0629..ff25fd4187 100644
--- a/meta/recipes-core/glibc/glibc-package.inc
+++ b/meta/recipes-core/glibc/glibc-package.inc
@@ -152,7 +152,7 @@ do_install_append_armeb () {
 }
 
 do_install_armmultilib () {
-	oe_multilib_header bits/endian.h bits/fcntl.h bits/fenv.h bits/fp-fast.h bits/hwcap.h bits/ipc.h bits/link.h bits/wordsize.h
+	oe_multilib_header bits/endian.h bits/fcntl.h bits/fenv.h bits/fp-fast.h bits/hwcap.h bits/ipc.h bits/link.h
 	oe_multilib_header bits/local_lim.h bits/mman.h bits/msq.h bits/pthreadtypes.h bits/pthreadtypes-arch.h  bits/sem.h  bits/semaphore.h bits/setjmp.h
 	oe_multilib_header bits/shm.h bits/sigstack.h bits/stat.h bits/statfs.h bits/typesizes.h
 	oe_multilib_header bits/procfs-id.h bits/procfs.h bits/shmlba.h
-- 
2.26.2


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

* [PATCH 3/6] multilib_header_wrapper.h: Remove pragma once
  2020-05-16 15:58 [PATCH 1/6] glibc: Unify wordsize.h for arm and aarch64 Khem Raj
  2020-05-16 15:58 ` [PATCH 2/6] glibc: Do not synthesize wordsize.h for arm multilibs Khem Raj
@ 2020-05-16 15:58 ` Khem Raj
  2020-05-16 15:58 ` [PATCH 4/6] multilib_header: Fall back to worsize form libc for bpf target Khem Raj
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Khem Raj @ 2020-05-16 15:58 UTC (permalink / raw)
  To: openembedded-core; +Cc: Khem Raj

This was a bandaid to avoid include recursion caused by multilibbed
wordsize.h

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 scripts/multilib_header_wrapper.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/scripts/multilib_header_wrapper.h b/scripts/multilib_header_wrapper.h
index c81e7ee5e8..62b57ca8ee 100644
--- a/scripts/multilib_header_wrapper.h
+++ b/scripts/multilib_header_wrapper.h
@@ -5,8 +5,6 @@
  * 
  */
 
-#pragma once
-
 #if defined (__bpf__)
 #define __MHWORDSIZE			64
 #elif defined (__arm__)
-- 
2.26.2


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

* [PATCH 4/6] multilib_header: Fall back to worsize form libc for bpf target
  2020-05-16 15:58 [PATCH 1/6] glibc: Unify wordsize.h for arm and aarch64 Khem Raj
  2020-05-16 15:58 ` [PATCH 2/6] glibc: Do not synthesize wordsize.h for arm multilibs Khem Raj
  2020-05-16 15:58 ` [PATCH 3/6] multilib_header_wrapper.h: Remove pragma once Khem Raj
@ 2020-05-16 15:58 ` Khem Raj
  2020-05-16 15:58 ` [PATCH 5/6] multilib_header_wrapper: Drop using __MHWORDSIZE Khem Raj
  2020-05-16 15:58 ` [PATCH 6/6] syslinux: Fix build with gcc10 Khem Raj
  4 siblings, 0 replies; 6+ messages in thread
From: Khem Raj @ 2020-05-16 15:58 UTC (permalink / raw)
  To: openembedded-core; +Cc: Khem Raj

Setting bpf to use 64bit for wordlength is not right, it happens to
work perhaps becuase the targets its being run on are 64bit inherently

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 scripts/multilib_header_wrapper.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/scripts/multilib_header_wrapper.h b/scripts/multilib_header_wrapper.h
index 62b57ca8ee..df01b56a72 100644
--- a/scripts/multilib_header_wrapper.h
+++ b/scripts/multilib_header_wrapper.h
@@ -5,9 +5,7 @@
  * 
  */
 
-#if defined (__bpf__)
-#define __MHWORDSIZE			64
-#elif defined (__arm__)
+#if defined (__arm__)
 #define __MHWORDSIZE			32
 #elif defined (__aarch64__) && defined ( __LP64__)
 #define __MHWORDSIZE			64
-- 
2.26.2


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

* [PATCH 5/6] multilib_header_wrapper: Drop using __MHWORDSIZE
  2020-05-16 15:58 [PATCH 1/6] glibc: Unify wordsize.h for arm and aarch64 Khem Raj
                   ` (2 preceding siblings ...)
  2020-05-16 15:58 ` [PATCH 4/6] multilib_header: Fall back to worsize form libc for bpf target Khem Raj
@ 2020-05-16 15:58 ` Khem Raj
  2020-05-16 15:58 ` [PATCH 6/6] syslinux: Fix build with gcc10 Khem Raj
  4 siblings, 0 replies; 6+ messages in thread
From: Khem Raj @ 2020-05-16 15:58 UTC (permalink / raw)
  To: openembedded-core; +Cc: Khem Raj

This is not needed as __WORDSIZE already represents same value and is
directly defined in wordsize.h, this simplifies the multlib headers

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 scripts/multilib_header_wrapper.h | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/scripts/multilib_header_wrapper.h b/scripts/multilib_header_wrapper.h
index df01b56a72..88f3193812 100644
--- a/scripts/multilib_header_wrapper.h
+++ b/scripts/multilib_header_wrapper.h
@@ -5,22 +5,9 @@
  * 
  */
 
-#if defined (__arm__)
-#define __MHWORDSIZE			32
-#elif defined (__aarch64__) && defined ( __LP64__)
-#define __MHWORDSIZE			64
-#elif defined (__aarch64__)
-#define __MHWORDSIZE			32
-#else
 #include <bits/wordsize.h>
-#if defined (__WORDSIZE)
-#define __MHWORDSIZE			__WORDSIZE
-#else
-#error "__WORDSIZE is not defined"
-#endif
-#endif
 
-#if __MHWORDSIZE == 32
+#if __WORDSIZE == 32
 
 #ifdef _MIPS_SIM
 
@@ -36,7 +23,7 @@
 #include <ENTER_HEADER_FILENAME_HERE-32.h>
 #endif
 
-#elif __MHWORDSIZE == 64
+#elif __WORDSIZE == 64
 #include <ENTER_HEADER_FILENAME_HERE-64.h>
 #else
 #error "Unknown __WORDSIZE detected"
-- 
2.26.2


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

* [PATCH 6/6] syslinux: Fix build with gcc10
  2020-05-16 15:58 [PATCH 1/6] glibc: Unify wordsize.h for arm and aarch64 Khem Raj
                   ` (3 preceding siblings ...)
  2020-05-16 15:58 ` [PATCH 5/6] multilib_header_wrapper: Drop using __MHWORDSIZE Khem Raj
@ 2020-05-16 15:58 ` Khem Raj
  4 siblings, 0 replies; 6+ messages in thread
From: Khem Raj @ 2020-05-16 15:58 UTC (permalink / raw)
  To: openembedded-core; +Cc: Khem Raj

Bring in a patch from fedora to fix -fno-common issue

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...multiple-definition-of-symbol-errors.patch | 97 +++++++++++++++++++
 .../syslinux/syslinux_6.04-pre2.bb            |  1 +
 2 files changed, 98 insertions(+)
 create mode 100644 meta/recipes-devtools/syslinux/syslinux/0010-Workaround-multiple-definition-of-symbol-errors.patch

diff --git a/meta/recipes-devtools/syslinux/syslinux/0010-Workaround-multiple-definition-of-symbol-errors.patch b/meta/recipes-devtools/syslinux/syslinux/0010-Workaround-multiple-definition-of-symbol-errors.patch
new file mode 100644
index 0000000000..44cb153276
--- /dev/null
+++ b/meta/recipes-devtools/syslinux/syslinux/0010-Workaround-multiple-definition-of-symbol-errors.patch
@@ -0,0 +1,97 @@
+From 951928f2cad5682c2844e6bd0f7201236c5d9b66 Mon Sep 17 00:00:00 2001
+From: Merlin Mathesius <mmathesi@redhat.com>
+Date: Wed, 13 May 2020 08:02:27 -0500
+Subject: [PATCH] Workaround multiple definition of symbol errors
+
+Lifted from Fedora https://src.fedoraproject.org/rpms/syslinux/blob/master/f/0005-Workaround-multiple-definition-of-symbol-errors.patch
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+---
+ com32/cmenu/Makefile           | 2 +-
+ com32/elflink/ldlinux/Makefile | 2 +-
+ com32/gpllib/Makefile          | 2 +-
+ com32/hdt/Makefile             | 2 +-
+ core/Makefile                  | 2 +-
+ dos/Makefile                   | 2 +-
+ efi/Makefile                   | 2 +-
+ 7 files changed, 7 insertions(+), 7 deletions(-)
+
+--- a/com32/cmenu/Makefile
++++ b/com32/cmenu/Makefile
+@@ -49,7 +49,7 @@ makeoutputdirs:
+ 	@mkdir -p $(OBJ)/libmenu
+ 
+ libmenu/libmenu.elf: $(LIBMENU)
+-	$(LD) -shared $(LDFLAGS) -soname $(patsubst %.elf,%.c32,$(@F)) \
++	$(LD) -shared $(LDFLAGS) -z muldefs -soname $(patsubst %.elf,%.c32,$(@F)) \
+ 		-o $@ $^
+ 
+ tidy dist:
+--- a/com32/elflink/ldlinux/Makefile
++++ b/com32/elflink/ldlinux/Makefile
+@@ -33,7 +33,7 @@ endif
+ all: $(BTARGET) ldlinux_lnx.a
+ 
+ ldlinux.elf : $(OBJS)
+-	$(LD) $(LDFLAGS) -soname $(SONAME) -o $@ $^ $(LIBS)
++	$(LD) $(LDFLAGS) -z muldefs -soname $(SONAME) -o $@ $^ $(LIBS)
+ 
+ LNXCFLAGS += -D__export='__attribute__((visibility("default")))'
+ LNXLIBOBJS = get_key.lo
+--- a/com32/gpllib/Makefile
++++ b/com32/gpllib/Makefile
+@@ -24,7 +24,7 @@ makeoutputdirs:
+ 		$(addprefix $(OBJ),$(sort $(dir $(LIBOBJS)))),$(b))
+ 
+ libgpl.elf : $(LIBOBJS)
+-	$(LD) -shared $(LDFLAGS) -soname $(patsubst %.elf,%.c32,$(@F)) -o $@ $^
++	$(LD) -shared $(LDFLAGS) -z muldefs -soname $(patsubst %.elf,%.c32,$(@F)) -o $@ $^
+ 
+ tidy dist clean:
+ 	find . \( -name \*.o -o -name .\*.d -o -name \*.tmp \) -print0 | \
+--- a/com32/hdt/Makefile
++++ b/com32/hdt/Makefile
+@@ -52,7 +52,7 @@ QEMU			?= qemu-kvm
+ all: $(MODULES) $(TESTFILES)
+ 
+ hdt.elf : $(OBJS) $(LIBS) $(C_LIBS)
+-	$(LD) $(LDFLAGS) -o $@ $^
++	$(LD) $(LDFLAGS) -z muldefs -o $@ $^
+ 
+ memtest:
+ 	-[ ! -f $(FLOPPY_DIR)/$(MEMTEST) ] && $(WGET) $(MEMTEST_URL) -O $(FLOPPY_DIR)/$(MEMTEST)
+--- a/core/Makefile
++++ b/core/Makefile
+@@ -156,7 +156,7 @@ LDSCRIPT = $(SRC)/$(ARCH)/syslinux.ld
+ NASM_ELF = elf
+ 
+ %.elf: %.o $(LIBDEP) $(LDSCRIPT) $(AUXLIBS)
+-	$(LD) $(LDFLAGS) -pie -Bsymbolic \
++	$(LD) $(LDFLAGS) -z muldefs -pie -Bsymbolic \
+ 		-T $(LDSCRIPT) \
+ 		--unresolved-symbols=report-all \
+ 		-E --hash-style=gnu -M -o $@ $< \
+--- a/dos/Makefile
++++ b/dos/Makefile
+@@ -19,7 +19,7 @@ include $(MAKEDIR)/embedded.mk
+ CFLAGS	+= -D__MSDOS__ -mregparm=3 -DREGPARM=3
+ # CFLAGS  += -DDEBUG
+ 
+-LDFLAGS	 = -T $(SRC)/dosexe.ld
++LDFLAGS	 = -T $(SRC)/dosexe.ld -z muldefs
+ OPTFLAGS = -g
+ INCLUDES = -include code16.h -nostdinc -iwithprefix include \
+ 	   -I$(SRC) -I$(SRC)/.. -I$(SRC)/../libfat \
+--- a/efi/Makefile
++++ b/efi/Makefile
+@@ -71,7 +71,7 @@ $(OBJS): | $(OBJ)/$(ARCH)
+ BTARGET  = syslinux.efi
+ 
+ syslinux.so: $(OBJS) $(CORE_OBJS) $(LIB_OBJS)
+-	$(LD) $(LDFLAGS) --strip-debug -o $@ $^ -lgnuefi -lefi
++	$(LD) $(LDFLAGS) -z muldefs --strip-debug -o $@ $^ -lgnuefi -lefi
+ 
+ # We need to rename the .hash section because the EFI firmware
+ # linker really doesn't like it.
diff --git a/meta/recipes-devtools/syslinux/syslinux_6.04-pre2.bb b/meta/recipes-devtools/syslinux/syslinux_6.04-pre2.bb
index e9dbefb930..3e7eef3a75 100644
--- a/meta/recipes-devtools/syslinux/syslinux_6.04-pre2.bb
+++ b/meta/recipes-devtools/syslinux/syslinux_6.04-pre2.bb
@@ -20,6 +20,7 @@ SRC_URI = "https://www.zytor.com/pub/syslinux/Testing/6.04/syslinux-${PV}.tar.xz
            file://0007-linux-syslinux-implement-ext_construct_sectmap_fs.patch \
            file://0008-libinstaller-syslinuxext-implement-syslinux_patch_bo.patch \
            file://0009-linux-syslinux-implement-install_bootblock.patch \
+           file://0010-Workaround-multiple-definition-of-symbol-errors.patch \
            file://0001-install-don-t-install-obsolete-file-com32.ld.patch \
            "
 
-- 
2.26.2


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

end of thread, other threads:[~2020-05-16 15:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-16 15:58 [PATCH 1/6] glibc: Unify wordsize.h for arm and aarch64 Khem Raj
2020-05-16 15:58 ` [PATCH 2/6] glibc: Do not synthesize wordsize.h for arm multilibs Khem Raj
2020-05-16 15:58 ` [PATCH 3/6] multilib_header_wrapper.h: Remove pragma once Khem Raj
2020-05-16 15:58 ` [PATCH 4/6] multilib_header: Fall back to worsize form libc for bpf target Khem Raj
2020-05-16 15:58 ` [PATCH 5/6] multilib_header_wrapper: Drop using __MHWORDSIZE Khem Raj
2020-05-16 15:58 ` [PATCH 6/6] syslinux: Fix build with gcc10 Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.