public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [patch, sim] Fix simulator Makefile
@ 2013-11-22 20:00 Steve Ellcey 
  2013-11-25  7:49 ` Mike Frysinger
  0 siblings, 1 reply; 3+ messages in thread
From: Steve Ellcey  @ 2013-11-22 20:00 UTC (permalink / raw)
  To: gdb-patches

I am trying to build a complete 32 bit toolchain, including the simulator,
 on an x86-64 Linux box by setting CFLAGS and CXXFLAGS to '-O2 -g -m32'.
I ran into a problem when building the simulator because in the igen
subdirectory make is using -m32 when compiling the objects that go into igen
but not on the link line.

I tried setting LDFLAGS to -m32 but that did not help.  I noticed that a
number of other targets in that Makefile (that no longer appear to be used)
use $(BUILD_CFLAGS) as well as $(BUILD_LDFLAGS) when linking.  Making that
change when building igen fixed the problem.

This may be considered an obvious fix, but I thought I would send it out
first anyway just to double check.

OK to checkin?

Steve Ellcey
sellcey@mips.com



2013-11-22  Steve Ellcey  <sellcey@mips.com>

	* igen/Makefile.in (igen): Use BUILD_CFLAGS in link.


diff --git a/sim/igen/Makefile.in b/sim/igen/Makefile.in
index 7b2375c..8f6a42c 100644
--- a/sim/igen/Makefile.in
+++ b/sim/igen/Makefile.in
@@ -117,7 +117,7 @@ IGEN_OBJS=\
 	gen.o
 
 igen: igen.o $(IGEN_OBJS)
-	$(CC_FOR_BUILD) $(BUILD_LDFLAGS) -o igen igen.o $(IGEN_OBJS) $(LIBIBERTY_LIB)
+	$(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o igen igen.o $(IGEN_OBJS) $(LIBIBERTY_LIB)
 
 igen.o: igen.c misc.h filter_host.h lf.h table.h ld-decode.h ld-cache.h ld-insn.h filter.h gen-model.h gen-itable.h gen-icache.h gen-idecode.h gen-engine.h gen-semantics.h gen-support.h gen.h igen.h 
 	$(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/igen.c

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

* Re: [patch, sim] Fix simulator Makefile
  2013-11-22 20:00 [patch, sim] Fix simulator Makefile Steve Ellcey 
@ 2013-11-25  7:49 ` Mike Frysinger
  2013-11-25  8:15   ` Mike Frysinger
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Frysinger @ 2013-11-25  7:49 UTC (permalink / raw)
  To: gdb-patches; +Cc: Steve Ellcey , gdb-patches

[-- Attachment #1: Type: Text/Plain, Size: 830 bytes --]

On Friday 22 November 2013 14:34:41 Steve Ellcey wrote:
> I am trying to build a complete 32 bit toolchain, including the simulator,
>  on an x86-64 Linux box by setting CFLAGS and CXXFLAGS to '-O2 -g -m32'.
> I ran into a problem when building the simulator because in the igen
> subdirectory make is using -m32 when compiling the objects that go into
> igen but not on the link line.
> 
> I tried setting LDFLAGS to -m32 but that did not help.  I noticed that a
> number of other targets in that Makefile (that no longer appear to be used)
> use $(BUILD_CFLAGS) as well as $(BUILD_LDFLAGS) when linking.  Making that
> change when building igen fixed the problem.
> 
> This may be considered an obvious fix, but I thought I would send it out
> first anyway just to double check.
> 
> OK to checkin?

OK
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [patch, sim] Fix simulator Makefile
  2013-11-25  7:49 ` Mike Frysinger
@ 2013-11-25  8:15   ` Mike Frysinger
  0 siblings, 0 replies; 3+ messages in thread
From: Mike Frysinger @ 2013-11-25  8:15 UTC (permalink / raw)
  To: gdb-patches; +Cc: Steve Ellcey , gdb-patches

[-- Attachment #1: Type: Text/Plain, Size: 830 bytes --]

On Friday 22 November 2013 14:34:41 Steve Ellcey wrote:
> I am trying to build a complete 32 bit toolchain, including the simulator,
>  on an x86-64 Linux box by setting CFLAGS and CXXFLAGS to '-O2 -g -m32'.
> I ran into a problem when building the simulator because in the igen
> subdirectory make is using -m32 when compiling the objects that go into
> igen but not on the link line.
> 
> I tried setting LDFLAGS to -m32 but that did not help.  I noticed that a
> number of other targets in that Makefile (that no longer appear to be used)
> use $(BUILD_CFLAGS) as well as $(BUILD_LDFLAGS) when linking.  Making that
> change when building igen fixed the problem.
> 
> This may be considered an obvious fix, but I thought I would send it out
> first anyway just to double check.
> 
> OK to checkin?

OK
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2013-11-25  4:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-22 20:00 [patch, sim] Fix simulator Makefile Steve Ellcey 
2013-11-25  7:49 ` Mike Frysinger
2013-11-25  8: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).