public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Stubbs <ams@codesourcery.com>
To: Newlib <newlib@sourceware.org>
Subject: Re: amdgcn build failure
Date: Mon, 21 Mar 2022 14:25:45 +0000	[thread overview]
Message-ID: <817069b6-873f-54e1-e466-8d4ae827a9ea@codesourcery.com> (raw)
In-Reply-To: <YjaBRPk5f0DG3rFW@vapier>

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

On 20/03/2022 01:20, Mike Frysinger wrote:
> i think you should always use the same name output if you want to override
> regardless of my recent change.  the common code defines this in mlock.c,
> so i would expect you to put your machine overrides in a mlock.c file in
> your machine dir.
> 
> this is how all the setjmp, mem*, and str* funcs all work.
> -mike

OK, I've confirmed that this patch fixes it.

I don't believe I have the power to commit it myself.

Andrew

[-- Attachment #2: 220321-newlib-mlock-fix.patch --]
[-- Type: text/plain, Size: 9250 bytes --]

amdgcn: Fix build failure

The recent makefile reorganization broke the amdgcn port by creating
duplicate __malloc_lock symbols.  This patch fixes the problem by renaming
the malloc_support.c file to mlock.c, thus overriding the default symbol
properly.  Actually, I'm not sure how this ever worked?

diff --git a/newlib/Makefile.in b/newlib/Makefile.in
index bdd41af02..3143308b0 100644
--- a/newlib/Makefile.in
+++ b/newlib/Makefile.in
@@ -708,7 +708,7 @@ check_PROGRAMS =
 @HAVE_LIBC_MACHINE_AMDGCN_TRUE@	libc/machine/amdgcn/abort.c \
 @HAVE_LIBC_MACHINE_AMDGCN_TRUE@	libc/machine/amdgcn/exit.c \
 @HAVE_LIBC_MACHINE_AMDGCN_TRUE@	libc/machine/amdgcn/atexit.c \
-@HAVE_LIBC_MACHINE_AMDGCN_TRUE@	libc/machine/amdgcn/malloc_support.c \
+@HAVE_LIBC_MACHINE_AMDGCN_TRUE@	libc/machine/amdgcn/mlock.c \
 @HAVE_LIBC_MACHINE_AMDGCN_TRUE@	libc/machine/amdgcn/getreent.c \
 @HAVE_LIBC_MACHINE_AMDGCN_TRUE@	libc/machine/amdgcn/signal.c
 
@@ -2007,7 +2007,7 @@ am__objects_53 = libc/ssp/libc_a-chk_fail.$(OBJEXT) \
 @HAVE_LIBC_MACHINE_AMDGCN_TRUE@am__objects_81 = libc/machine/amdgcn/libc_a-abort.$(OBJEXT) \
 @HAVE_LIBC_MACHINE_AMDGCN_TRUE@	libc/machine/amdgcn/libc_a-exit.$(OBJEXT) \
 @HAVE_LIBC_MACHINE_AMDGCN_TRUE@	libc/machine/amdgcn/libc_a-atexit.$(OBJEXT) \
-@HAVE_LIBC_MACHINE_AMDGCN_TRUE@	libc/machine/amdgcn/libc_a-malloc_support.$(OBJEXT) \
+@HAVE_LIBC_MACHINE_AMDGCN_TRUE@	libc/machine/amdgcn/libc_a-mlock.$(OBJEXT) \
 @HAVE_LIBC_MACHINE_AMDGCN_TRUE@	libc/machine/amdgcn/libc_a-getreent.$(OBJEXT) \
 @HAVE_LIBC_MACHINE_AMDGCN_TRUE@	libc/machine/amdgcn/libc_a-signal.$(OBJEXT)
 @HAVE_LIBC_MACHINE_ARC_TRUE@am__objects_82 = libc/machine/arc/libc_a-memcmp.$(OBJEXT) \
@@ -8081,7 +8081,7 @@ libc/machine/amdgcn/libc_a-exit.$(OBJEXT):  \
 libc/machine/amdgcn/libc_a-atexit.$(OBJEXT):  \
 	libc/machine/amdgcn/$(am__dirstamp) \
 	libc/machine/amdgcn/$(DEPDIR)/$(am__dirstamp)
-libc/machine/amdgcn/libc_a-malloc_support.$(OBJEXT):  \
+libc/machine/amdgcn/libc_a-mlock.$(OBJEXT):  \
 	libc/machine/amdgcn/$(am__dirstamp) \
 	libc/machine/amdgcn/$(DEPDIR)/$(am__dirstamp)
 libc/machine/amdgcn/libc_a-getreent.$(OBJEXT):  \
@@ -12242,7 +12242,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@libc/machine/amdgcn/$(DEPDIR)/libc_a-atexit.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@libc/machine/amdgcn/$(DEPDIR)/libc_a-exit.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@libc/machine/amdgcn/$(DEPDIR)/libc_a-getreent.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@libc/machine/amdgcn/$(DEPDIR)/libc_a-malloc_support.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libc/machine/amdgcn/$(DEPDIR)/libc_a-mlock.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@libc/machine/amdgcn/$(DEPDIR)/libc_a-signal.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@libc/machine/arc/$(DEPDIR)/libc_a-memcmp-bs-norm.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@libc/machine/arc/$(DEPDIR)/libc_a-memcmp-stub.Po@am__quote@
@@ -33397,19 +33397,19 @@ libc/machine/amdgcn/libc_a-atexit.obj: libc/machine/amdgcn/atexit.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/machine/amdgcn/libc_a-atexit.obj `if test -f 'libc/machine/amdgcn/atexit.c'; then $(CYGPATH_W) 'libc/machine/amdgcn/atexit.c'; else $(CYGPATH_W) '$(srcdir)/libc/machine/amdgcn/atexit.c'; fi`
 
-libc/machine/amdgcn/libc_a-malloc_support.o: libc/machine/amdgcn/malloc_support.c
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/machine/amdgcn/libc_a-malloc_support.o -MD -MP -MF libc/machine/amdgcn/$(DEPDIR)/libc_a-malloc_support.Tpo -c -o libc/machine/amdgcn/libc_a-malloc_support.o `test -f 'libc/machine/amdgcn/malloc_support.c' || echo '$(srcdir)/'`libc/machine/amdgcn/malloc_support.c
-@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) libc/machine/amdgcn/$(DEPDIR)/libc_a-malloc_support.Tpo libc/machine/amdgcn/$(DEPDIR)/libc_a-malloc_support.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='libc/machine/amdgcn/malloc_support.c' object='libc/machine/amdgcn/libc_a-malloc_support.o' libtool=no @AMDEPBACKSLASH@
+libc/machine/amdgcn/libc_a-mlock.o: libc/machine/amdgcn/mlock.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/machine/amdgcn/libc_a-mlock.o -MD -MP -MF libc/machine/amdgcn/$(DEPDIR)/libc_a-mlock.Tpo -c -o libc/machine/amdgcn/libc_a-mlock.o `test -f 'libc/machine/amdgcn/mlock.c' || echo '$(srcdir)/'`libc/machine/amdgcn/mlock.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) libc/machine/amdgcn/$(DEPDIR)/libc_a-mlock.Tpo libc/machine/amdgcn/$(DEPDIR)/libc_a-mlock.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='libc/machine/amdgcn/mlock.c' object='libc/machine/amdgcn/libc_a-mlock.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/machine/amdgcn/libc_a-malloc_support.o `test -f 'libc/machine/amdgcn/malloc_support.c' || echo '$(srcdir)/'`libc/machine/amdgcn/malloc_support.c
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/machine/amdgcn/libc_a-mlock.o `test -f 'libc/machine/amdgcn/mlock.c' || echo '$(srcdir)/'`libc/machine/amdgcn/mlock.c
 
-libc/machine/amdgcn/libc_a-malloc_support.obj: libc/machine/amdgcn/malloc_support.c
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/machine/amdgcn/libc_a-malloc_support.obj -MD -MP -MF libc/machine/amdgcn/$(DEPDIR)/libc_a-malloc_support.Tpo -c -o libc/machine/amdgcn/libc_a-malloc_support.obj `if test -f 'libc/machine/amdgcn/malloc_support.c'; then $(CYGPATH_W) 'libc/machine/amdgcn/malloc_support.c'; else $(CYGPATH_W) '$(srcdir)/libc/machine/amdgcn/malloc_support.c'; fi`
-@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) libc/machine/amdgcn/$(DEPDIR)/libc_a-malloc_support.Tpo libc/machine/amdgcn/$(DEPDIR)/libc_a-malloc_support.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='libc/machine/amdgcn/malloc_support.c' object='libc/machine/amdgcn/libc_a-malloc_support.obj' libtool=no @AMDEPBACKSLASH@
+libc/machine/amdgcn/libc_a-mlock.obj: libc/machine/amdgcn/mlock.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/machine/amdgcn/libc_a-mlock.obj -MD -MP -MF libc/machine/amdgcn/$(DEPDIR)/libc_a-mlock.Tpo -c -o libc/machine/amdgcn/libc_a-mlock.obj `if test -f 'libc/machine/amdgcn/mlock.c'; then $(CYGPATH_W) 'libc/machine/amdgcn/mlock.c'; else $(CYGPATH_W) '$(srcdir)/libc/machine/amdgcn/mlock.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) libc/machine/amdgcn/$(DEPDIR)/libc_a-mlock.Tpo libc/machine/amdgcn/$(DEPDIR)/libc_a-mlock.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='libc/machine/amdgcn/mlock.c' object='libc/machine/amdgcn/libc_a-mlock.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/machine/amdgcn/libc_a-malloc_support.obj `if test -f 'libc/machine/amdgcn/malloc_support.c'; then $(CYGPATH_W) 'libc/machine/amdgcn/malloc_support.c'; else $(CYGPATH_W) '$(srcdir)/libc/machine/amdgcn/malloc_support.c'; fi`
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/machine/amdgcn/libc_a-mlock.obj `if test -f 'libc/machine/amdgcn/mlock.c'; then $(CYGPATH_W) 'libc/machine/amdgcn/mlock.c'; else $(CYGPATH_W) '$(srcdir)/libc/machine/amdgcn/mlock.c'; fi`
 
 libc/machine/amdgcn/libc_a-getreent.o: libc/machine/amdgcn/getreent.c
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/machine/amdgcn/libc_a-getreent.o -MD -MP -MF libc/machine/amdgcn/$(DEPDIR)/libc_a-getreent.Tpo -c -o libc/machine/amdgcn/libc_a-getreent.o `test -f 'libc/machine/amdgcn/getreent.c' || echo '$(srcdir)/'`libc/machine/amdgcn/getreent.c
diff --git a/newlib/libc/machine/amdgcn/Makefile.inc b/newlib/libc/machine/amdgcn/Makefile.inc
index 6253e4d70..d26603aa8 100644
--- a/newlib/libc/machine/amdgcn/Makefile.inc
+++ b/newlib/libc/machine/amdgcn/Makefile.inc
@@ -2,6 +2,6 @@ libc_a_SOURCES += \
 	%D%/abort.c \
 	%D%/exit.c \
 	%D%/atexit.c \
-	%D%/malloc_support.c \
+	%D%/mlock.c \
 	%D%/getreent.c \
 	%D%/signal.c
diff --git a/newlib/libc/machine/amdgcn/malloc_support.c b/newlib/libc/machine/amdgcn/mlock.c
similarity index 100%
rename from newlib/libc/machine/amdgcn/malloc_support.c
rename to newlib/libc/machine/amdgcn/mlock.c

  reply	other threads:[~2022-03-21 14:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-18 11:43 Andrew Stubbs
2022-03-20  1:20 ` Mike Frysinger
2022-03-21 14:25   ` Andrew Stubbs [this message]
2022-03-23  1:45     ` Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=817069b6-873f-54e1-e466-8d4ae827a9ea@codesourcery.com \
    --to=ams@codesourcery.com \
    --cc=newlib@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).