public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* Finish internalization of HAVE_INITFINI_ARRAY work
@ 2022-01-29  4:40 Jeff Law
  2022-01-29  5:15 ` Mike Frysinger
  0 siblings, 1 reply; 2+ messages in thread
From: Jeff Law @ 2022-01-29  4:40 UTC (permalink / raw)
  To: newlib

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

Mike's work in this space didn't fix the references to 
HAVE_INITFINI_ARRAY and HAVE_INIT_FINI in libgloss. As a result 
init/fini support was busted for a few targets.  or1k had massive GCC 
testsuite failures due to undefined references. cris failed a few tests 
which depended on global ctors/dtors running properly.  I don't use 
newlib for testing aarch64 or arm, but they clearly need the same 
obvious change.

Given the obviousness, I'm going to go ahead and install the attached patch.



Jeff


[-- Attachment #2: 0001-Finish-this-commit-by-prefixing-HAVE_INITFINI_ARRAY-.patch --]
[-- Type: text/plain, Size: 3334 bytes --]

From c07283b16752983220c9d655ed6910f25a2d9937 Mon Sep 17 00:00:00 2001
From: Jeff Law <jeffreyalaw@gmail.com>
Date: Fri, 28 Jan 2022 21:26:18 -0700
Subject: [PATCH] Finish this commit by prefixing HAVE_INITFINI_ARRAY and
 HAVE_INIT_FINI references in libgloss in the same way.

commit 437c5c5085ff30b4a4960b2b53d06728c788361d
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Mon Jan 17 22:20:20 2022 -0500

    newlib: internalize HAVE_INITFINI_ARRAY

    This define is only used by newlib internally, so stop exporting it
    as HAVE_INITFINI_ARRAY since this can conflict with defines packages
    use themselves.

    We don't really need to add _ to HAVE_INIT_FINI too since it isn't
    exported in newlib.h, but might as well be consistent here.

    We can't (easily) add this to newlib_cflags like HAVE_INIT_FINI is
    because this is based on a compile-time test in the top configure,
    not on plain shell code in configure.host.  We'd have to replicate
    the test in every subdir in order to have it passed down.
---
 libgloss/aarch64/crt0.S | 4 ++--
 libgloss/arm/crt0.S     | 2 +-
 libgloss/cris/crt0.S    | 2 +-
 libgloss/cris/lcrt0.c   | 2 +-
 libgloss/or1k/crt0.S    | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/libgloss/aarch64/crt0.S b/libgloss/aarch64/crt0.S
index f831be12e..78c5263dc 100644
--- a/libgloss/aarch64/crt0.S
+++ b/libgloss/aarch64/crt0.S
@@ -36,7 +36,7 @@
 #error __USER_LABEL_PREFIX is not defined
 #endif
 
-#ifdef HAVE_INITFINI_ARRAY
+#ifdef _HAVE_INITFINI_ARRAY
 #define _init	__libc_init_array
 #define _fini	__libc_fini_array
 #endif
@@ -309,4 +309,4 @@ CommandLine:	.space	256,0	/*  Maximum length of 255 chars handled.  */
 AngelSVCArgs:
 	GEN_DWORD CommandLine
 	.dword	255
-#endif
\ No newline at end of file
+#endif
diff --git a/libgloss/arm/crt0.S b/libgloss/arm/crt0.S
index 8490bde2f..78515180b 100644
--- a/libgloss/arm/crt0.S
+++ b/libgloss/arm/crt0.S
@@ -12,7 +12,7 @@
 #error __USER_LABEL_PREFIX is not defined
 #endif
 
-#ifdef HAVE_INITFINI_ARRAY
+#ifdef _HAVE_INITFINI_ARRAY
 #define _init	__libc_init_array
 #define _fini	__libc_fini_array
 #endif
diff --git a/libgloss/cris/crt0.S b/libgloss/cris/crt0.S
index 30419887e..6edaabf45 100644
--- a/libgloss/cris/crt0.S
+++ b/libgloss/cris/crt0.S
@@ -36,7 +36,7 @@
 #define L(x) _ ## x
 #endif
 
-#ifdef HAVE_INITFINI_ARRAY
+#ifdef _HAVE_INITFINI_ARRAY
 #define _init __libc_init_array
 #define _fini __libc_fini_array
 #endif
diff --git a/libgloss/cris/lcrt0.c b/libgloss/cris/lcrt0.c
index 8b8cc0bb0..48489edd3 100644
--- a/libgloss/cris/lcrt0.c
+++ b/libgloss/cris/lcrt0.c
@@ -29,7 +29,7 @@
 #include "linunistd.h"
 #include "newlib.h"
 
-#ifdef HAVE_INITFINI_ARRAY
+#ifdef _HAVE_INITFINI_ARRAY
 #define _init __libc_init_array
 #define _fini __libc_fini_array
 #endif
diff --git a/libgloss/or1k/crt0.S b/libgloss/or1k/crt0.S
index 03d732355..74a040981 100644
--- a/libgloss/or1k/crt0.S
+++ b/libgloss/or1k/crt0.S
@@ -97,7 +97,7 @@ _or1k_exception_stack_size:	.word EXCEPTION_STACK_SIZE
                                                                               */
 /* -------------------------------------------------------------------------- */
 
-#ifdef HAVE_INITFINI_ARRAY
+#ifdef _HAVE_INITFINI_ARRAY
 #define _init	__libc_init_array
 #define _fini	__libc_fini_array
 #endif
-- 
2.34.1


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

* Re: Finish internalization of HAVE_INITFINI_ARRAY work
  2022-01-29  4:40 Finish internalization of HAVE_INITFINI_ARRAY work Jeff Law
@ 2022-01-29  5:15 ` Mike Frysinger
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Frysinger @ 2022-01-29  5:15 UTC (permalink / raw)
  To: Jeff Law; +Cc: newlib

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

On 28 Jan 2022 21:40, Jeff Law wrote:
> Mike's work in this space didn't fix the references to 
> HAVE_INITFINI_ARRAY and HAVE_INIT_FINI in libgloss. As a result 
> init/fini support was busted for a few targets.  or1k had massive GCC 
> testsuite failures due to undefined references. cris failed a few tests 
> which depended on global ctors/dtors running properly.  I don't use 
> newlib for testing aarch64 or arm, but they clearly need the same 
> obvious change.
> 
> Given the obviousness, I'm going to go ahead and install the attached patch.

ack, thanks!
-mike

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2022-01-29  5:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-29  4:40 Finish internalization of HAVE_INITFINI_ARRAY work Jeff Law
2022-01-29  5:15 ` Mike Frysinger

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