public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Makerules: Do not require startup files for format.lds probe object
@ 2021-01-12 12:02 Florian Weimer
  2021-01-12 12:07 ` Adhemerval Zanella
  0 siblings, 1 reply; 2+ messages in thread
From: Florian Weimer @ 2021-01-12 12:02 UTC (permalink / raw)
  To: libc-alpha; +Cc: Adhemerval Zanella, Andreas Schwab, Fangrui Song

During statically linked bootstrap, the compiler does not have
the required startup files, so do a smaller dummy link to obtain
the output format information.

Fixes commit 87d583c6e8cd0e49f64da76636ebeec033298b4d ("install:
Replace scripts/output-format.sed with objdump -f [BZ #26559]").

Testing is still in progress, but looks good so far.

---
 Makerules | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/Makerules b/Makerules
index 06c7c48310..ca9885436e 100644
--- a/Makerules
+++ b/Makerules
@@ -1067,9 +1067,8 @@ install: $(inst_slibdir)/libc.so$(libc.so-version)
 # used by a link for a different format on a multi-architecture system.
 $(common-objpfx)format.lds: $(common-objpfx)config.make \
 			    $(common-objpfx)config.h $(..)Makerules
-	$(LINK.o) -shared $(sysdep-LDFLAGS) $(rtld-LDFLAGS) \
-		  $(LDFLAGS.so) $(LDFLAGS-lib.so) \
-		  -x c /dev/null -o $@.so 2>/dev/null
+	$(LINK.o) -shared -nostdlib -nostartfiles \
+		  -x assembler /dev/null -o $@.so
 	$(OBJDUMP) -f $@.so | sed -n 's/.*file format \(.*\)/OUTPUT_FORMAT(\1)/;T;p' > $@
 	rm -f $@.so
 common-generated += format.lds

-- 
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill


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

* Re: [PATCH] Makerules: Do not require startup files for format.lds probe object
  2021-01-12 12:02 [PATCH] Makerules: Do not require startup files for format.lds probe object Florian Weimer
@ 2021-01-12 12:07 ` Adhemerval Zanella
  0 siblings, 0 replies; 2+ messages in thread
From: Adhemerval Zanella @ 2021-01-12 12:07 UTC (permalink / raw)
  To: Florian Weimer, libc-alpha; +Cc: Andreas Schwab, Fangrui Song



On 12/01/2021 09:02, Florian Weimer wrote:
> During statically linked bootstrap, the compiler does not have
> the required startup files, so do a smaller dummy link to obtain
> the output format information.
> 
> Fixes commit 87d583c6e8cd0e49f64da76636ebeec033298b4d ("install:
> Replace scripts/output-format.sed with objdump -f [BZ #26559]").
> 
> Testing is still in progress, but looks good so far.
> 

LGTM, this does fix the bootstrap issue I am also seeing.

> ---
>  Makerules | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/Makerules b/Makerules
> index 06c7c48310..ca9885436e 100644
> --- a/Makerules
> +++ b/Makerules
> @@ -1067,9 +1067,8 @@ install: $(inst_slibdir)/libc.so$(libc.so-version)
>  # used by a link for a different format on a multi-architecture system.
>  $(common-objpfx)format.lds: $(common-objpfx)config.make \
>  			    $(common-objpfx)config.h $(..)Makerules
> -	$(LINK.o) -shared $(sysdep-LDFLAGS) $(rtld-LDFLAGS) \
> -		  $(LDFLAGS.so) $(LDFLAGS-lib.so) \
> -		  -x c /dev/null -o $@.so 2>/dev/null
> +	$(LINK.o) -shared -nostdlib -nostartfiles \
> +		  -x assembler /dev/null -o $@.so
>  	$(OBJDUMP) -f $@.so | sed -n 's/.*file format \(.*\)/OUTPUT_FORMAT(\1)/;T;p' > $@
>  	rm -f $@.so
>  common-generated += format.lds
> 

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

end of thread, other threads:[~2021-01-12 12:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-12 12:02 [PATCH] Makerules: Do not require startup files for format.lds probe object Florian Weimer
2021-01-12 12:07 ` Adhemerval Zanella

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).