Set up GDB_CONF_FLAGS from the configure utility. This avoids duplication of
logic between configure.c and Makefile. Additionally, the new method ensures
that the gdb target always matches the configured crash target. This may
become useful when we allow cross-compiling crash for a different target
(think of arm on x86, for example).
+#define GDB_TARGET_X86 "GDB_CONF_FLAGS=--target=i686-pc-linux-gnu"
+#define GDB_TARGET_ALPHA "GDB_CONF_FLAGS=--target=alpha-linux-gnu"
+#define GDB_TARGET_PPC "GDB_CONF_FLAGS=--target=powerpc-linux-gnu"
+#define GDB_TARGET_IA64 "GDB_CONF_FLAGS=--target=ia64-linux-gnu"
+#define GDB_TARGET_S390 "GDB_CONF_FLAGS=--target=s390-ibm-linux-gnu"
+#define GDB_TARGET_S390X "GDB_CONF_FLAGS=--target=s390x-ibm-linux-gnu"
+#define GDB_TARGET_PPC64 "GDB_CONF_FLAGS=--target=powerpc64-linux-gnu"
+#define GDB_TARGET_X86_64 "GDB_CONF_FLAGS=--target=x86_64-pc-linux-gnu"
+#define GDB_TARGET_ARM "GDB_CONF_FLAGS=--target=arm-elf-linux-gnu"
+
/*
* The original plan was to allow the use of a particular version
* of gdb for a given architecture. But for practical purposes,
@@ -512,6 +522,7 @@ build_configure(struct supported_gdb_ver
char buf[512];
char *target;
char *target_CFLAGS;
+ char *gdb_conf_flags;
#
# Supported targets: X86 ALPHA PPC IA64 PPC64
-# TARGET will be configured automatically by configure
+# TARGET and GDB_CONF_FLAGS will be configured automatically by configure
#
TARGET=
+GDB_CONF_FLAGS=
--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
01-27-2011, 02:07 PM
Dave Anderson
Cleanup GDB_CONF_FLAGS settings
----- Original Message -----
> Set up GDB_CONF_FLAGS from the configure utility. This avoids duplication of
> logic between configure.c and Makefile. Additionally, the new method ensures
> that the gdb target always matches the configured crash target. This may
> become useful when we allow cross-compiling crash for a different target
> (think of arm on x86, for example).
>
Other than potentially having an x86_64-host/64-bit-ARM-target binary
in the future, I don't see any future cross-compiling happening. The
current ARM support on x86/x86_64 hosts only exists by luck due to its
similarity in endian-ness and word size with x86. So cross-compiling
the embedded gdb module won't have any affect on the crash source code.
The other thing is -- and I haven't tested this -- is that when we
build the crash utility, it doesn't necessarily have the same configuration
strings that you hardwire. I'm not sure what that means with respect
to the gdb module? For example, our x86_64 and ia64 builds configure
them as:
ia64-unknown-linux-gnu
x86_64-unknown-linux-gnu
(I haven't checked any of the other arches...)
So I'm wondering whether forcing them to a different string would
have any effect on systems with build tools that come up with a
different string? Do you have any insight there?
--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
01-27-2011, 11:06 PM
Petr Tesarik
Cleanup GDB_CONF_FLAGS settings
Dne čtvrtek 27 Leden 2011 16:07:57 Dave Anderson napsal(a):
> ----- Original Message -----
>
> > Set up GDB_CONF_FLAGS from the configure utility. This avoids duplication
> > of logic between configure.c and Makefile. Additionally, the new method
> > ensures that the gdb target always matches the configured crash target.
> > This may become useful when we allow cross-compiling crash for a
> > different target (think of arm on x86, for example).
>
> Other than potentially having an x86_64-host/64-bit-ARM-target binary
> in the future, I don't see any future cross-compiling happening. The
> current ARM support on x86/x86_64 hosts only exists by luck due to its
> similarity in endian-ness and word size with x86. So cross-compiling
> the embedded gdb module won't have any affect on the crash source code.
Well, I was talking about compiling an arm crash binary on x86_64 (with a
cross-compiler). Anyway, this was not my primary motivation.
I'm still pursuing a cross-platform crash project (not necessarily merged with
your sources), and getting as much as possible into upstream would make my
life easier. So, I'm sending the bits that are beneficial to both.
> The other thing is -- and I haven't tested this -- is that when we
> build the crash utility, it doesn't necessarily have the same configuration
> strings that you hardwire. I'm not sure what that means with respect
> to the gdb module? For example, our x86_64 and ia64 builds configure
> them as:
>
> ia64-unknown-linux-gnu
This is in fact the expanded form of ia64-linux-gnu. You can see that if you
run "gdb-7.0/config.sub ia64-linux-gnu".
> x86_64-unknown-linux-gnu
Interesting. I thought it was consistent on the "pc" part. And this code
snippet from gdb 7.0's config.sub suggests the "unknown" tag is not used:
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
i*86 | x86_64)
basic_machine=$basic_machine-pc
;;
> (I haven't checked any of the other arches...)
>
> So I'm wondering whether forcing them to a different string would
> have any effect on systems with build tools that come up with a
> different string? Do you have any insight there?
In theory, yes. In practice, there is no difference for all *-*-linux-gnu
targets. BTW you had already hardwired the target specification for ARM and
X86 if they are cross-compiled...
--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
01-28-2011, 12:59 PM
Dave Anderson
Cleanup GDB_CONF_FLAGS settings
----- Original Message -----
> >
> > So I'm wondering whether forcing them to a different string would
> > have any effect on systems with build tools that come up with a
> > different string? Do you have any insight there?
>
> In theory, yes. In practice, there is no difference for all *-*-linux-gnu
> targets. BTW you had already hardwired the target specification for ARM and
> X86 if they are cross-compiled...
Right -- but in those two situations there was no choice but to
essentially copy what the native builds created.
Dave
--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility