public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] sim: ppc: use silent build rules here too
@ 2021-10-31  9:27 Mike Frysinger
  2021-11-02 23:58 ` will schmidt
  0 siblings, 1 reply; 8+ messages in thread
From: Mike Frysinger @ 2021-10-31  9:27 UTC (permalink / raw)
  To: gdb-patches

The ppc codebase is unique and doesn't leverage common/, so have to
add silent rules to it specifically.
---
 sim/ppc/Makefile.in | 96 ++++++++++++++++++++++-----------------------
 sim/ppc/dgen.c      |  2 +
 sim/ppc/igen.c      |  2 +
 3 files changed, 50 insertions(+), 50 deletions(-)

diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in
index 29f4010d3d18..8f4cd997d303 100644
--- a/sim/ppc/Makefile.in
+++ b/sim/ppc/Makefile.in
@@ -141,7 +141,7 @@ TARGETLIB	= libsim.a
 all:	run$(EXEEXT) $(TARGETLIB) $(GDB_OBJ)
 
 .c.o:
-	$(CC) -c $(STD_CFLAGS) $<
+	$(ECHO_CC) $(CC) -c $(STD_CFLAGS) $<
 
 
 # Headers outside sim/ppc.
@@ -521,16 +521,15 @@ PACKAGE_OBJ = @sim_pk_obj@
 
 
 psim$(EXEEXT): $(TARGETLIB) main.o $(LIBIBERTY_LIB) $(BFD_LIB) $(LIBINTL_DEP)
-	$(CC) $(CFLAGS) $(LDFLAGS) -o psim$(EXEEXT) main.o $(TARGETLIB) $(BFD_LIB) $(ZLIB) $(LIBINTL) $(LIBIBERTY_LIB) $(LIBS)
+	$(ECHO_CCLD) $(CC) $(CFLAGS) $(LDFLAGS) -o psim$(EXEEXT) main.o $(TARGETLIB) $(BFD_LIB) $(ZLIB) $(LIBINTL) $(LIBIBERTY_LIB) $(LIBS)
 
 run$(EXEEXT): psim$(EXEEXT)
-	rm -f $@
-	ln $< $@ 2>/dev/null || $(LN_S) $< $@ 2>/dev/null || cp -p $< $@
+	$(SILENCE) rm -f $@
+	$(ECHO_GEN) ln $< $@ 2>/dev/null || $(LN_S) $< $@ 2>/dev/null || cp -p $< $@
 
 $(TARGETLIB): tmp-igen tmp-dgen tmp-hw tmp-pk tmp-defines $(LIB_OBJ) $(GDB_OBJ)
-	rm -f $(TARGETLIB)
-	$(AR) $(AR_FLAGS) $(TARGETLIB) $(LIB_OBJ) $(GDB_OBJ)
-	$(RANLIB) $(TARGETLIB)
+	$(ECHO_AR) $(AR) $(AR_FLAGS) $(TARGETLIB) $(LIB_OBJ) $(GDB_OBJ)
+	$(ECHO_RANLIB) $(RANLIB) $(TARGETLIB)
 
 psim.o: psim.c $(CPU_H) $(IDECODE_H) $(OPTIONS_H) $(TREE_H) $(BFD_H)
 
@@ -598,43 +597,40 @@ mon.o: mon.c $(BASICS_H) $(CPU_H) $(MON_H)
 # GDB after 4.16 expects the default_callback structure to be setup.
 # As a kludge, build the common stuff here for now.
 gentmap: $(srcdir)/../common/gentmap.c Makefile targ-vals.def
-	$(LINK_FOR_BUILD) -I. -I../common -I$(srcdir)/../common \
+	$(ECHO_CCLD) $(LINK_FOR_BUILD) -I. -I../common -I$(srcdir)/../common \
 		$(srcdir)/../common/gentmap.c -DUSE_CONFIG_H
 
 targ-vals.def: $(srcdir)/../common/nltvals.def
-	rm -f targ-vals.def tmp-def
-	cat $(srcdir)/../common/nltvals.def > tmp-vals.def
+	$(ECHO_GEN) cat $(srcdir)/../common/nltvals.def > tmp-vals.def
 	$(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-vals.def targ-vals.def
 
 targ-vals.h: stamp-vals ; @true
 stamp-vals: Makefile gentmap $(srcroot)/move-if-change
-	rm -f tmp-vals.h
-	./gentmap -h > tmp-vals.h
+	$(ECHO_GEN) ./gentmap -h > tmp-vals.h
 	$(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-vals.h targ-vals.h
-	@echo stamp > stamp-vals
+	$(SILENCE) touch $@
 
 targ-map.c: stamp-map; @true
 stamp-map: Makefile gentmap $(srcroot)/move-if-change
-	rm -f tmp-map.c
-	./gentmap -c > tmp-map.c
+	$(ECHO_GEN) ./gentmap -c > tmp-map.c
 	$(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-map.c targ-map.c
-	@echo stamp > stamp-map
+	$(SILENCE) touch $@
 
 callback.o: $(srcdir)/../common/callback.c $(TARG_VALS_H) $(CONFIG_H)
-	$(CC) -c $(STD_CFLAGS) -DHAVE_CONFIG_H $(srcdir)/../common/callback.c
+	$(ECHO_CC) $(CC) -c $(STD_CFLAGS) -DHAVE_CONFIG_H $(srcdir)/../common/callback.c
 
 targ-map.o: targ-map.c $(ANSIDECL_H) $(GDB_CALLBACK_H) $(TARG_VALS_H)
 
 sim-fpu.o: $(srcdir)/../common/sim-fpu.c $(CONFIG_H)
-	$(CC) -c $(STD_CFLAGS) -DHAVE_CONFIG_H $(srcdir)/../common/sim-fpu.c 
+	$(ECHO_CC) $(CC) -c $(STD_CFLAGS) -DHAVE_CONFIG_H $(srcdir)/../common/sim-fpu.c 
 
 # Rebuild options whenever something changes so the date/time is up to date.
 options.o: options.c $(CPU_H) $(OPTIONS_H) $(DEFINES_H) $(BASICS_H) $(IDECODE_H) $(INLINE) $(LIB_SRC) $(BUILT_SRC) config.status Makefile
-	$(CC) -c $(STD_CFLAGS) '-DOPCODE_RULES="@sim_opcode@"' '-DIGEN_FLAGS="$(IGEN_FLAGS)"' '-DDGEN_FLAGS="$(DGEN_FLAGS)"' $(srcdir)/options.c
+	$(ECHO_CC) $(CC) -c $(STD_CFLAGS) '-DOPCODE_RULES="@sim_opcode@"' '-DIGEN_FLAGS="$(IGEN_FLAGS)"' '-DDGEN_FLAGS="$(DGEN_FLAGS)"' $(srcdir)/options.c
 
 defines.h: tmp-defines; @true
 tmp-defines: config.h Makefile
-	sed -n -e '/^#define HAVE_/s/ 1$$/",/' -e '/^#define HAVE_/s//"HAVE_/p' < config.h > tmp-defines.h
+	$(ECHO_GEN) sed -n -e '/^#define HAVE_/s/ 1$$/",/' -e '/^#define HAVE_/s//"HAVE_/p' < config.h > tmp-defines.h
 	$(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-defines.h defines.h
 	$(SILENCE) touch $@
 
@@ -643,7 +639,7 @@ tmp-defines: config.h Makefile
 #
 
 tmp-dgen: dgen ppc-spr-table $(srcroot)/move-if-change
-	$(DGEN) $(DGEN_FLAGS) \
+	$(ECHO_GEN) $(DGEN) $(DGEN_FLAGS) \
 		-r $(srcdir)/ppc-spr-table \
 		-n spreg.h -hp tmp-spreg.h \
 		-n spreg.c -p  tmp-spreg.c
@@ -652,7 +648,7 @@ tmp-dgen: dgen ppc-spr-table $(srcroot)/move-if-change
 	$(SILENCE) touch $@
 
 tmp-igen: igen $(srcdir)/ppc-instructions $(srcdir)/altivec.igen $(srcdir)/e500.igen $(IGEN_OPCODE_RULES) $(srcroot)/move-if-change tmp-ld-decode tmp-ld-cache tmp-ld-insn tmp-filter
-	$(IGEN) $(IGEN_FLAGS) \
+	$(ECHO_GEN) $(IGEN) $(IGEN_FLAGS) \
 		-o $(srcdir)/$(IGEN_OPCODE_RULES) \
 		-I $(srcdir) -i $(srcdir)/ppc-instructions \
 		-n icache.h    -hc tmp-icache.h \
@@ -689,77 +685,77 @@ itable.h itable.c icache.h icache.c idecode.h idecode.c semantics.h semantics.c
 spreg.h spreg.c: tmp-dgen
 
 dgen: dgen.o table.o lf.o misc.o filter_host.o
-	$(LINK_FOR_BUILD) dgen.o table.o lf.o misc.o filter_host.o
+	$(ECHO_CCLD) $(LINK_FOR_BUILD) dgen.o table.o lf.o misc.o filter_host.o
 
 igen: igen.o table.o lf.o misc.o filter_host.o ld-decode.o ld-cache.o filter.o ld-insn.o gen-model.o gen-itable.o gen-icache.o gen-semantics.o gen-idecode.o gen-support.o
-	$(LINK_FOR_BUILD) igen.o table.o lf.o misc.o filter_host.o ld-decode.o ld-cache.o filter.o ld-insn.o gen-model.o gen-itable.o gen-icache.o gen-semantics.o gen-idecode.o gen-support.o
+	$(ECHO_CCLD) $(LINK_FOR_BUILD) igen.o table.o lf.o misc.o filter_host.o ld-decode.o ld-cache.o filter.o ld-insn.o gen-model.o gen-itable.o gen-icache.o gen-semantics.o gen-idecode.o gen-support.o
 
 filter_host.c: filter_filename.c
-	cat $(srcdir)/filter_filename.c > filter_host.c
+	$(ECHO_GEN) cat $(srcdir)/filter_filename.c > filter_host.c
 
 filter_host.o: filter_host.c $(CONFIG_H) $(FILTER_FILENAME_H)
-	$(COMPILE_FOR_BUILD) -c filter_host.c
+	$(ECHO_CC) $(COMPILE_FOR_BUILD) -c filter_host.c
 
 table.o: table.c $(CONFIG_H) $(MISC_H) $(LF_H) $(TABLE_H)
-	$(COMPILE_FOR_BUILD) -c $(srcdir)/table.c
+	$(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/table.c
 
 lf.o: lf.c $(CONFIG_H) $(MISC_H) $(LF_H)
-	$(COMPILE_FOR_BUILD) -c $(srcdir)/lf.c
+	$(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/lf.c
 
 filter.o: filter.c $(CONFIG_H) $(MISC_H) $(FILTER_H)
-	$(COMPILE_FOR_BUILD) -c $(srcdir)/filter.c
+	$(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/filter.c
 tmp-filter: filter.c $(MISC_H) misc.o
-	$(LINK_FOR_BUILD) -DMAIN $(srcdir)/filter.c misc.o
+	$(ECHO_CCLD) $(LINK_FOR_BUILD) -DMAIN $(srcdir)/filter.c misc.o
 
 ld-decode.o: ld-decode.c $(MISC_H) $(LF_H) $(TABLE_H) $(LD_DECODE_H)
-	$(COMPILE_FOR_BUILD) -c $(srcdir)/ld-decode.c
+	$(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/ld-decode.c
 tmp-ld-decode: ld-decode.c misc.o lf.o table.o filter_host.o 
-	$(LINK_FOR_BUILD) -DMAIN $(srcdir)/ld-decode.c misc.o lf.o table.o filter_host.o
+	$(ECHO_CCLD) $(LINK_FOR_BUILD) -DMAIN $(srcdir)/ld-decode.c misc.o lf.o table.o filter_host.o
 
 ld-cache.o: ld-cache.c $(MISC_H) $(LF_H) $(TABLE_H) $(LD_CACHE_H)
-	$(COMPILE_FOR_BUILD) -c $(srcdir)/ld-cache.c
+	$(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/ld-cache.c
 tmp-ld-cache: ld-cache.c misc.o lf.o table.o filter_host.o 
-	$(LINK_FOR_BUILD) -DMAIN $(srcdir)/ld-cache.c misc.o lf.o table.o filter_host.o
+	$(ECHO_CCLD) $(LINK_FOR_BUILD) -DMAIN $(srcdir)/ld-cache.c misc.o lf.o table.o filter_host.o
 
 ld-insn.o: ld-insn.c $(MISC_H) $(LF_H) $(TABLE_H) $(FILTER_H) $(LD_DECODE_H) $(LD_CACHE_H) $(LD_INSN_H) $(IGEN_H)
-	$(COMPILE_FOR_BUILD) -c $(srcdir)/ld-insn.c
+	$(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/ld-insn.c
 tmp-ld-insn: ld-insn.c ld-cache.o misc.o lf.o table.o ld-decode.o filter_host.o filter.o
-	$(LINK_FOR_BUILD) -DMAIN $(srcdir)/ld-insn.c ld-cache.o misc.o lf.o table.o ld-decode.o filter_host.o filter.o
+	$(ECHO_CCLD) $(LINK_FOR_BUILD) -DMAIN $(srcdir)/ld-insn.c ld-cache.o misc.o lf.o table.o ld-decode.o filter_host.o filter.o
 
 gen-model.o: gen-model.c $(MISC_H) $(LF_H) $(TABLE_H) $(FILTER_H) $(LD_CACHE_H) $(LD_DECODE_H) $(LD_INSN_H) $(GEN_MODEL_H)
-	$(COMPILE_FOR_BUILD) -c $(srcdir)/gen-model.c
+	$(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/gen-model.c
 
 gen-itable.o: gen-itable.c $(MISC_H) $(LF_H) $(TABLE_H) $(FILTER_H) $(LD_CACHE_H) $(LD_DECODE_H) $(LD_INSN_H) $(IGEN_H) $(GEN_ITABLE_H)
-	$(COMPILE_FOR_BUILD) -c $(srcdir)/gen-itable.c
+	$(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/gen-itable.c
 
 gen-icache.o: gen-icache.c $(MISC_H) $(LF_H) $(TABLE_H) $(FILTER_H) $(LD_DECODE_H) $(LD_CACHE_H) $(LD_INSN_H) $(IGEN_H) $(GEN_SEMANTICS_H) $(GEN_IDECODE_H) $(GEN_ICACHE_H)
-	$(COMPILE_FOR_BUILD) -c $(srcdir)/gen-icache.c
+	$(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/gen-icache.c
 
 gen-semantics.o: gen-semantics.c $(MISC_H) $(LF_H) $(TABLE_H) $(FILTER_H) $(LD_DECODE_H) $(LD_CACHE_H) $(LD_INSN_H) $(IGEN_H) $(GEN_SEMANTICS_H) $(GEN_ICACHE_H) $(GEN_IDECODE_H)
-	$(COMPILE_FOR_BUILD) -c $(srcdir)/gen-semantics.c
+	$(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/gen-semantics.c
 
 gen-idecode.o: gen-idecode.c $(MISC_H) $(LF_H) $(TABLE_H) $(FILTER_H) $(LD_DECODE_H) $(LD_CACHE_H) $(LD_INSN_H) $(IGEN_H) $(GEN_IDECODE_H) $(GEN_ICACHE_H) $(GEN_SEMANTICS_H)
-	$(COMPILE_FOR_BUILD) -c $(srcdir)/gen-idecode.c
+	$(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/gen-idecode.c
 
 gen-support.o: gen-support.c $(MISC_H) $(LF_H) $(TABLE_H) $(FILTER_H) $(LD_DECODE_H) $(LD_CACHE_H) $(LD_INSN_H) $(IGEN_H) $(GEN_SEMANTICS_H) $(GEN_SUPPORT_H)
-	$(COMPILE_FOR_BUILD) -c $(srcdir)/gen-support.c
+	$(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/gen-support.c
 
 dgen.o: dgen.c $(CONFIG_H) $(MISC_H) $(LF_H) $(TABLE_H)
-	$(COMPILE_FOR_BUILD) -c $(srcdir)/dgen.c
+	$(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/dgen.c
 
 igen.o: igen.c $(MISC_H) $(LF_H) $(TABLE_H) $(CONFIG_H) $(FILTER_H) $(LD_CACHE_H) $(LD_DECODE_H) $(LD_INSN_H) $(IGEN_H) $(GEN_MODEL_H) $(GEN_ICACHE_H) $(GEN_ITABLE_H) $(GEN_IDECODE_H) $(GEN_SEMANTICS_H) $(GEN_SUPPORT_H)
-	$(COMPILE_FOR_BUILD) -c $(srcdir)/igen.c
+	$(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/igen.c
 
 misc.o: misc.c $(CONFIG_H) $(MISC_H)
-	$(COMPILE_FOR_BUILD) -c $(srcdir)/misc.c
+	$(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/misc.c
 
 
 
 # real hardware
 hw.c hw.h: tmp-hw; @true
 tmp-hw: Makefile $(HW_SRC) $(srcroot)/move-if-change
-	# The first for loop is to remove duplicates.
-	f=""; \
+	$(ECHO_GEN)# The first for loop is to remove duplicates.
+	$(SILENCE) f=""; \
 	for i in $(HW_SRC) ; do \
 	  case " $$f " in \
 	    *" $$i "*) ;; \
@@ -771,7 +767,7 @@ tmp-hw: Makefile $(HW_SRC) $(srcroot)/move-if-change
 		-e 's/^/extern const device_descriptor /' \
 		-e 's/$$/_device_descriptor\[\];/' \
 		> tmp-hw.h
-	f=""; \
+	$(SILENCE) f=""; \
 	for i in $(HW_SRC) ; do \
 	  case " $$f " in \
 	    *" $$i "*) ;; \
@@ -814,8 +810,8 @@ hw_vm.o: hw_vm.c $(DEVICE_TABLE_H) $(CPU_H)
 # real packages
 pk.h: tmp-pk; @true
 tmp-pk: Makefile $(PACKAGE_SRC) $(srcroot)/move-if-change
-	# The first for loop is to remove duplicates.
-	f=""; \
+	$(ECHO_GEN)# The first for loop is to remove duplicates.
+	$(SILENCE) f=""; \
 	for i in $(PACKAGE_SRC) ; do \
 	  case " $$f " in \
 	    *" $$i "*) ;; \
diff --git a/sim/ppc/dgen.c b/sim/ppc/dgen.c
index 9437944a9a6b..a1c1d56e8dc1 100644
--- a/sim/ppc/dgen.c
+++ b/sim/ppc/dgen.c
@@ -286,7 +286,9 @@ main(int argc,
 
 
   while ((ch = getopt(argc, argv, "hLsn:r:p:")) != -1) {
+#if 0  /* For debugging.  */
     fprintf(stderr, "\t-%c %s\n", ch, ( optarg ? optarg : ""));
+#endif
     switch(ch) {
     case 's':
       spreg_lookup_table = 0;
diff --git a/sim/ppc/igen.c b/sim/ppc/igen.c
index f0ff06b31c41..6a6dbc30f319 100644
--- a/sim/ppc/igen.c
+++ b/sim/ppc/igen.c
@@ -393,7 +393,9 @@ main(int argc,
   while ((ch = getopt(argc, argv,
 		      "F:EI:RSLJT:CB:H:N:o:k:i:n:hc:d:m:s:t:f:"))
 	 != -1) {
+#if 0  /* For debugging.  */
     fprintf(stderr, "\t-%c %s\n", ch, (optarg ? optarg : ""));
+#endif
     switch(ch) {
     case 'C':
       code |= generate_with_icache;
-- 
2.33.0


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

* Re: [PATCH] sim: ppc: use silent build rules here too
  2021-10-31  9:27 [PATCH] sim: ppc: use silent build rules here too Mike Frysinger
@ 2021-11-02 23:58 ` will schmidt
  2021-11-03  3:07   ` Mike Frysinger
  0 siblings, 1 reply; 8+ messages in thread
From: will schmidt @ 2021-11-02 23:58 UTC (permalink / raw)
  To: Mike Frysinger, gdb-patches

On Sun, 2021-10-31 at 05:27 -0400, Mike Frysinger via Gdb-patches
wrote:
> The ppc codebase is unique and doesn't leverage common/, so have to
> add silent rules to it specifically.

Hi,
  I may have evidence to the contrary.  :-)   I don't see any changes
here or in the recent patches that I can specifically identify as
troublesome, but something seems fishy between sim/ppc/libsim.a and
sim/common/libcommon.a ;      I'm seeing this error during recent build
attempts on ppc64le, sometime since late last week. 


/home/willschm/install/bin/ld:
../sim/ppc/libsim.a(callback.o):(.toc+0x10): undefined reference to
`cb_init_errno_map'
/home/willschm/install/bin/ld:
../sim/ppc/libsim.a(callback.o):(.toc+0x18): undefined reference to
`cb_init_signal_map'
/home/willschm/install/bin/ld:
../sim/ppc/libsim.a(callback.o):(.toc+0x20): undefined reference to
`cb_init_open_map'


The 'missing' symbols appear to be located in sim/common/libcommon.a 

Thanks,
-Will



> ---
>  sim/ppc/Makefile.in | 96 ++++++++++++++++++++++---------------------
> --
>  sim/ppc/dgen.c      |  2 +
>  sim/ppc/igen.c      |  2 +
>  3 files changed, 50 insertions(+), 50 deletions(-)

<snip>



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

* Re: [PATCH] sim: ppc: use silent build rules here too
  2021-11-02 23:58 ` will schmidt
@ 2021-11-03  3:07   ` Mike Frysinger
  2021-11-03 15:38     ` will schmidt
  2021-11-03 16:55     ` will schmidt
  0 siblings, 2 replies; 8+ messages in thread
From: Mike Frysinger @ 2021-11-03  3:07 UTC (permalink / raw)
  To: will schmidt; +Cc: gdb-patches

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

On 02 Nov 2021 18:58, will schmidt wrote:
> On Sun, 2021-10-31 at 05:27 -0400, Mike Frysinger via Gdb-patches
> wrote:
> > The ppc codebase is unique and doesn't leverage common/, so have to
> > add silent rules to it specifically.
> 
>   I may have evidence to the contrary.  :-)   I don't see any changes
> here or in the recent patches that I can specifically identify as
> troublesome, but something seems fishy between sim/ppc/libsim.a and
> sim/common/libcommon.a ;      I'm seeing this error during recent build
> attempts on ppc64le, sometime since late last week. 

this patch is unrelated to any link failures like this

> /home/willschm/install/bin/ld:
> ../sim/ppc/libsim.a(callback.o):(.toc+0x10): undefined reference to
> `cb_init_errno_map'
> /home/willschm/install/bin/ld:
> ../sim/ppc/libsim.a(callback.o):(.toc+0x18): undefined reference to
> `cb_init_signal_map'
> /home/willschm/install/bin/ld:
> ../sim/ppc/libsim.a(callback.o):(.toc+0x20): undefined reference to
> `cb_init_open_map'

you've removed important details from the log ... like what program is
failing to link here ?
-mike

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

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

* Re: [PATCH] sim: ppc: use silent build rules here too
  2021-11-03  3:07   ` Mike Frysinger
@ 2021-11-03 15:38     ` will schmidt
  2021-11-03 23:47       ` [PATCH 1/2] sim: ppc: switch to common builds for callback objects Mike Frysinger
  2021-11-03 23:48       ` [PATCH] sim: ppc: use silent build rules here too Mike Frysinger
  2021-11-03 16:55     ` will schmidt
  1 sibling, 2 replies; 8+ messages in thread
From: will schmidt @ 2021-11-03 15:38 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: gdb-patches

On Tue, 2021-11-02 at 23:07 -0400, Mike Frysinger wrote:
> On 02 Nov 2021 18:58, will schmidt wrote:
> > On Sun, 2021-10-31 at 05:27 -0400, Mike Frysinger via Gdb-patches
> > wrote:
> > > The ppc codebase is unique and doesn't leverage common/, so have
> > > to
> > > add silent rules to it specifically.
> > 
> >   I may have evidence to the contrary.  :-)   I don't see any
> > changes
> > here or in the recent patches that I can specifically identify as
> > troublesome, but something seems fishy between sim/ppc/libsim.a and
> > sim/common/libcommon.a ;      I'm seeing this error during recent
> > build
> > attempts on ppc64le, sometime since late last week. 
> 
> this patch is unrelated to any link failures like this

Hi, 
Agree.. I don't see anything obvious.  Just the combination of sim and
ppc and common catch my eye and seem to be the involved pieces.  A bit
more below.

> 
> > /home/willschm/install/bin/ld:
> > ../sim/ppc/libsim.a(callback.o):(.toc+0x10): undefined reference to
> > `cb_init_errno_map'
> > /home/willschm/install/bin/ld:
> > ../sim/ppc/libsim.a(callback.o):(.toc+0x18): undefined reference to
> > `cb_init_signal_map'
> > /home/willschm/install/bin/ld:
> > ../sim/ppc/libsim.a(callback.o):(.toc+0x20): undefined reference to
> > `cb_init_open_map'
> 
> you've removed important details from the log ... like what program
> is
> failing to link here ?
> -mike

GDB itself, in this case.  I respun without my local patches this
morning, and still see an issue.   More context around the error is
below.

I plan to bisect back in time a bit to confirm when this was
introduced.   I believe recently, but can't prove it.  :-)

Thanks,
-Will


--><-- 

$> make

<snip>
...
make[3]: Entering directory '/home/willschm/gdb_builds/gdb/sim'
Making all in ppc
make[4]: Entering directory '/home/willschm/gdb_builds/gdb/sim/ppc'
make[4]: Leaving directory '/home/willschm/gdb_builds/gdb/sim/ppc'
make[4]: Entering directory '/home/willschm/gdb_builds/gdb/sim'
make[4]: Leaving directory '/home/willschm/gdb_builds/gdb/sim'
make[3]: Leaving directory '/home/willschm/gdb_builds/gdb/sim'
make[2]: Leaving directory '/home/willschm/gdb_builds/gdb/sim'
make[2]: Entering directory '/home/willschm/gdb_builds/gdb/gdbsupport'
make  all-am
make[3]: Entering directory '/home/willschm/gdb_builds/gdb/gdbsupport'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/home/willschm/gdb_builds/gdb/gdbsupport'
make[2]: Leaving directory '/home/willschm/gdb_builds/gdb/gdbsupport'
make[2]: Entering directory '/home/willschm/gdb_builds/gdb/gdbserver'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/willschm/gdb_builds/gdb/gdbserver'
make[2]: Entering directory '/home/willschm/gdb_builds/gdb/gdb'
  CXXLD  gdb
/usr/lib64/gcc/powerpc64le-suse-linux/11/../../../../powerpc64le-suse-linux/bin/ld: ../sim/ppc/libsim.a(callback.o):(.toc+0x10): undefined reference to `cb_init_errno_map'
/usr/lib64/gcc/powerpc64le-suse-linux/11/../../../../powerpc64le-suse-linux/bin/ld: ../sim/ppc/libsim.a(callback.o):(.toc+0x18): undefined reference to `cb_init_signal_map'
/usr/lib64/gcc/powerpc64le-suse-linux/11/../../../../powerpc64le-suse-linux/bin/ld: ../sim/ppc/libsim.a(callback.o):(.toc+0x20): undefined reference to `cb_init_open_map'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:1904: gdb] Error 1
make[2]: Leaving directory '/home/willschm/gdb_builds/gdb.ltcd97-lp4.le.Nov03_2021_0940/gdb'
make[1]: *** [Makefile:12064: all-gdb] Error 2
make[1]: Leaving directory '/home/willschm/gdb_builds/gdb.ltcd97-lp4.le.Nov03_2021_0940'
make: *** [Makefile:903: all] Error 2







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

* Re: [PATCH] sim: ppc: use silent build rules here too
  2021-11-03  3:07   ` Mike Frysinger
  2021-11-03 15:38     ` will schmidt
@ 2021-11-03 16:55     ` will schmidt
  1 sibling, 0 replies; 8+ messages in thread
From: will schmidt @ 2021-11-03 16:55 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: gdb-patches

On Tue, 2021-11-02 at 23:07 -0400, Mike Frysinger wrote:
> On 02 Nov 2021 18:58, will schmidt wrote:
> > On Sun, 2021-10-31 at 05:27 -0400, Mike Frysinger via Gdb-patches
> > wrote:
> > > The ppc codebase is unique and doesn't leverage common/, so have
> > > to
> > > add silent rules to it specifically.
> > 
> >   I may have evidence to the contrary.  :-)   I don't see any
> > changes
> > here or in the recent patches that I can specifically identify as
> > troublesome, but something seems fishy between sim/ppc/libsim.a and
> > sim/common/libcommon.a ;      I'm seeing this error during recent
> > build
> > attempts on ppc64le, sometime since late last week. 
> 
> this patch is unrelated to any link failures like this
> 
> > /home/willschm/install/bin/ld:
> > ../sim/ppc/libsim.a(callback.o):(.toc+0x10): undefined reference to
> > `cb_init_errno_map'
> > /home/willschm/install/bin/ld:
> > ../sim/ppc/libsim.a(callback.o):(.toc+0x18): undefined reference to
> > `cb_init_signal_map'
> > /home/willschm/install/bin/ld:
> > ../sim/ppc/libsim.a(callback.o):(.toc+0x20): undefined reference to
> > `cb_init_open_map'
> 
> you've removed important details from the log ... like what program
> is
> failing to link here ?
> -mike

Hi, 

So.. Git bisect suggests one of the other patches.    I don't want to
confuse the threads, so will continue to reply on this thread, will hop
over to another thread if thats appropriate. :-) 



# first bad commit: [a7e40a99318c46ec57a9c0a64c622b6ec0ed89ff] sim: nltvals: pull target errno out into a dedicated source file

The error with that patch applied is :

  CXXLD  gdb
/usr/lib64/gcc/powerpc64le-suse-linux/11/../../../../powerpc64le-suse-linux/bin/ld: ../sim/ppc/libsim.a(callback.o):(.toc+0x10): undefined reference to `cb_init_errno_map'
collect2: error: ld returned 1 exit status



Presumably the undefined referece to cb_init_signal_map and cb_init_open_map fall in line with these subsequent patches.

670817b94710 sim: nltvals: pull target open flags out into a dedicated source file
88c8370b25c6 sim: nltvals: pull target signal out into a dedicated source file


Thanks,
-Will


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

* [PATCH 1/2] sim: ppc: switch to common builds for callback objects
  2021-11-03 15:38     ` will schmidt
@ 2021-11-03 23:47       ` Mike Frysinger
  2021-11-03 23:47         ` [PATCH 2/2] sim: ppc: inline common sim-fpu.c logic Mike Frysinger
  2021-11-03 23:48       ` [PATCH] sim: ppc: use silent build rules here too Mike Frysinger
  1 sibling, 1 reply; 8+ messages in thread
From: Mike Frysinger @ 2021-11-03 23:47 UTC (permalink / raw)
  To: gdb-patches

We don't need to build this anymore ourselves since the common build
includes it and produces the same object code.  We also need to pull
in the split constant modules after the refactoring and pulling them
out of nltvals.def & targ-map.o.  This doesn't matter for the sim
directly, but does for gdb and other users of libsim.

We also delete some conditional source tree logic since we already
require this be the "new" combined tree with a ../common/ dir.  This
has been the case for decades at this point.
---
 sim/ppc/Makefile.in  | 11 ++++++-----
 sim/ppc/configure    | 18 ------------------
 sim/ppc/configure.ac | 14 --------------
 3 files changed, 6 insertions(+), 37 deletions(-)

diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in
index 8f4cd997d303..2f8fe9b20b0e 100644
--- a/sim/ppc/Makefile.in
+++ b/sim/ppc/Makefile.in
@@ -430,7 +430,7 @@ BUILT_SRC_WO_CONFIG = \
 	pk.h \
 	hw.h hw.c \
 	filter_host.c \
-	@sim_targ_vals@
+	targ-vals.h targ-map.c targ-vals.def
 
 BUILT_SRC = \
 	$(BUILT_SRC_WO_CONFIG) \
@@ -469,6 +469,10 @@ MAIN_SRC = \
 	sim_calls.c
 
 COMMON_OBJS_NAMES = \
+	callback.o \
+	target-newlib-errno.o \
+	target-newlib-open.o \
+	target-newlib-signal.o \
 	version.o
 COMMON_OBJS = $(COMMON_OBJS_NAMES:%=../common/common_libcommon_a-%)
 
@@ -511,7 +515,7 @@ LIB_OBJ = \
 	options.o
 
 
-GDB_OBJ = gdb-sim.o sim_calls.o @sim_callback@
+GDB_OBJ = gdb-sim.o sim_calls.o targ-map.o
 
 HW_SRC = @sim_hw_src@
 HW_OBJ = @sim_hw_obj@
@@ -616,9 +620,6 @@ stamp-map: Makefile gentmap $(srcroot)/move-if-change
 	$(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-map.c targ-map.c
 	$(SILENCE) touch $@
 
-callback.o: $(srcdir)/../common/callback.c $(TARG_VALS_H) $(CONFIG_H)
-	$(ECHO_CC) $(CC) -c $(STD_CFLAGS) -DHAVE_CONFIG_H $(srcdir)/../common/callback.c
-
 targ-map.o: targ-map.c $(ANSIDECL_H) $(GDB_CALLBACK_H) $(TARG_VALS_H)
 
 sim-fpu.o: $(srcdir)/../common/sim-fpu.c $(CONFIG_H)
diff --git a/sim/ppc/configure.ac b/sim/ppc/configure.ac
index b837c5b8609e..8d5d78ce1dcd 100644
--- a/sim/ppc/configure.ac
+++ b/sim/ppc/configure.ac
@@ -545,18 +545,6 @@ else
   sim_devzero=""
 fi
 
-dnl Figure out if we are in the new Cygnus tree with a common directory or not
-AC_MSG_CHECKING(for common simulator directory)
-if test -f "${srcdir}/../common/callback.c"; then
-  AC_MSG_RESULT(yes)
-  sim_callback="callback.o targ-map.o"
-  sim_targ_vals="targ-vals.h targ-map.c targ-vals.def"
-else
-  AC_MSG_RESULT(no)
-  sim_callback=""
-  sim_targ_vals=""
-fi
-
 AC_MSG_CHECKING(for common simulator directory fpu implementation)
 if test -f "${srcdir}/../common/sim-fpu.c"; then
   AC_MSG_RESULT(yes)
@@ -624,8 +612,6 @@ AC_SUBST(sim_default_model)
 AC_SUBST(sim_model_issue)
 AC_SUBST(sim_termio)
 AC_SUBST(sim_devzero)
-AC_SUBST(sim_callback)
-AC_SUBST(sim_targ_vals)
 AC_SUBST(sim_fpu_cflags)
 AC_SUBST(sim_fpu)
 
-- 
2.33.0


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

* [PATCH 2/2] sim: ppc: inline common sim-fpu.c logic
  2021-11-03 23:47       ` [PATCH 1/2] sim: ppc: switch to common builds for callback objects Mike Frysinger
@ 2021-11-03 23:47         ` Mike Frysinger
  0 siblings, 0 replies; 8+ messages in thread
From: Mike Frysinger @ 2021-11-03 23:47 UTC (permalink / raw)
  To: gdb-patches

We will never bother building w/out a ../common/ sim directory,
so drop ancient logic supporting that method.
---
 sim/ppc/Makefile.in  |  4 ++--
 sim/ppc/configure    | 18 ------------------
 sim/ppc/configure.ac | 13 -------------
 3 files changed, 2 insertions(+), 33 deletions(-)

diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in
index 2f8fe9b20b0e..b9918954f37e 100644
--- a/sim/ppc/Makefile.in
+++ b/sim/ppc/Makefile.in
@@ -86,7 +86,7 @@ CONFIG_CFLAGS = \
   $(MODEL_CFLAGS) \
   $(TERMIO_CFLAGS) \
   $(DEVZERO_CFLAGS)
-SIM_FPU_CFLAGS = @sim_fpu_cflags@
+SIM_FPU_CFLAGS = -DHAVE_COMMON_FPU -I../common -I${srcdir}/../common
 
 STD_CFLAGS	= $(CFLAGS) $(WERROR_CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(WARN_CFLAGS) $(INCLUDES) $(INCGNU) $(INTL_CFLAGS) $(SIM_FPU_CFLAGS)
 NOWARN_CFLAGS	= $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(INCLUDES) $(SIM_FPU_CFLAGS)
@@ -507,7 +507,7 @@ LIB_OBJ = \
 	semantics.o \
 	idecode.o \
 	support.o \
-	@sim_fpu@ \
+	sim-fpu.o \
 	psim.o \
 	$(COMMON_OBJS) \
 	$(PACKAGE_OBJ) \
diff --git a/sim/ppc/configure.ac b/sim/ppc/configure.ac
index 8d5d78ce1dcd..75232006e94a 100644
--- a/sim/ppc/configure.ac
+++ b/sim/ppc/configure.ac
@@ -545,17 +545,6 @@ else
   sim_devzero=""
 fi
 
-AC_MSG_CHECKING(for common simulator directory fpu implementation)
-if test -f "${srcdir}/../common/sim-fpu.c"; then
-  AC_MSG_RESULT(yes)
-  sim_fpu_cflags="-DHAVE_COMMON_FPU -I../common -I${srcdir}/../common"
-  sim_fpu="sim-fpu.o"
-else
-  AC_MSG_RESULT(no)
-  sim_fpu_cflags=
-  sim_fpu=
-fi
-
 # Since we run commands on the build system, we have to create a
 # separate config header for the build system if build != host.
 if test x$host = x$build; then
@@ -612,8 +601,6 @@ AC_SUBST(sim_default_model)
 AC_SUBST(sim_model_issue)
 AC_SUBST(sim_termio)
 AC_SUBST(sim_devzero)
-AC_SUBST(sim_fpu_cflags)
-AC_SUBST(sim_fpu)
 
 AC_OUTPUT(Makefile,
 [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])
-- 
2.33.0


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

* Re: [PATCH] sim: ppc: use silent build rules here too
  2021-11-03 15:38     ` will schmidt
  2021-11-03 23:47       ` [PATCH 1/2] sim: ppc: switch to common builds for callback objects Mike Frysinger
@ 2021-11-03 23:48       ` Mike Frysinger
  1 sibling, 0 replies; 8+ messages in thread
From: Mike Frysinger @ 2021-11-03 23:48 UTC (permalink / raw)
  To: will schmidt; +Cc: gdb-patches

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

On 03 Nov 2021 10:38, will schmidt wrote:
> On Tue, 2021-11-02 at 23:07 -0400, Mike Frysinger wrote:
> > On 02 Nov 2021 18:58, will schmidt wrote:
> > > /home/willschm/install/bin/ld:
> > > ../sim/ppc/libsim.a(callback.o):(.toc+0x10): undefined reference to
> > > `cb_init_errno_map'
> > > /home/willschm/install/bin/ld:
> > > ../sim/ppc/libsim.a(callback.o):(.toc+0x18): undefined reference to
> > > `cb_init_signal_map'
> > > /home/willschm/install/bin/ld:
> > > ../sim/ppc/libsim.a(callback.o):(.toc+0x20): undefined reference to
> > > `cb_init_open_map'
> > 
> > you've removed important details from the log ... like what program
> > is failing to link here ?
> 
> GDB itself, in this case.  I respun without my local patches this
> morning, and still see an issue.   More context around the error is
> below.

i posted 2 patches to fix this.  the code in question is used by gdb and
the common sim, but not the psim which is why it slipped through.  thanks
for the heads up.
-mike

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

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

end of thread, other threads:[~2021-11-03 23:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-31  9:27 [PATCH] sim: ppc: use silent build rules here too Mike Frysinger
2021-11-02 23:58 ` will schmidt
2021-11-03  3:07   ` Mike Frysinger
2021-11-03 15:38     ` will schmidt
2021-11-03 23:47       ` [PATCH 1/2] sim: ppc: switch to common builds for callback objects Mike Frysinger
2021-11-03 23:47         ` [PATCH 2/2] sim: ppc: inline common sim-fpu.c logic Mike Frysinger
2021-11-03 23:48       ` [PATCH] sim: ppc: use silent build rules here too Mike Frysinger
2021-11-03 16:55     ` will schmidt

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