* RE: PATCH: Fix bfd.c (Re: Tracking down a build breakage)
@ 2001-08-11 11:13 Kazu Hirata
0 siblings, 0 replies; 7+ messages in thread
From: Kazu Hirata @ 2001-08-11 11:13 UTC (permalink / raw)
To: binutils
Hi,
> But my bfd_sprintf_vma/bfd_fprintf_vma change does break any BFD
> which doesn't include elf.lo. It seems to me that we should only
> check bfd_target_elf_flavour when elf is configured in BFD. Here
> is a patch. Any comments?
This seemd to be a problem when I was trying to build gdb.
> 2001-08-11 H.J. Lu <hjl@gnu.org>
>
> * Makefile.am (BFD_DEFINES): New. Substituted by @bfd_defines@.
> (INCLUDES): Add $(BFD_DEFINES).
> * Makefile.in: Regenerated.
>
> * configure.in (bfd_defines): Add -DHAVE_BFD_ELF if elf.lo
> is in $bfd_backend.
> (AC_SUBST(bfd_defines)): Added.
> * configure: Regenerated.
>
> * bfd.c (bfd_sprintf_vma): Check ELF only if HAVE_BFD_ELF is
> defined.
> (bfd_fprintf_vma): Likewise.
Amazingly, after doing "cvs co binutils", I did not have to apply your
patch to successfully build h8300 target. With your patch, the build
process got stuck as follows. The command line looks just fine. I
don't know why gcc makes such a complaint...
/bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I/home/kazu/gnu/binutils/binutils-head/src/bfd -I. -D_GNU_SOURCE @bfd_defines@ -I. -I/home/kazu/gnu/binutils/binutils-head/src/bfd -I/home/kazu/gnu/binutils/binutils-head/src/bfd/../include -I/home/kazu/gnu/binutils/binutils-head/src/bfd/../intl -I../intl -W -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -c /home/kazu/gnu/binutils/binutils-head/src/bfd/archive.c
gcc -DHAVE_CONFIG_H -I. -I/home/kazu/gnu/binutils/binutils-head/src/bfd -I. -D_GNU_SOURCE @bfd_defines@ -I. -I/home/kazu/gnu/binutils/binutils-head/src/bfd -I/home/kazu/gnu/binutils/binutils-head/src/bfd/../include -I/home/kazu/gnu/binutils/binutils-head/src/bfd/../intl -I../intl -W -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -c /home/kazu/gnu/binutils/binutils-head/src/bfd/archive.c -o archive.o
gcc: cannot specify -o with -c or -S and multiple compilations
make[3]: *** [archive.lo] Error 1
make[3]: Leaving directory `/var/tmp/h8300-hms-binutils-head-0811-2/bfd'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/var/tmp/h8300-hms-binutils-head-0811-2/bfd'
make[1]: *** [all-recursive-am] Error 2
make[1]: Leaving directory `/var/tmp/h8300-hms-binutils-head-0811-2/bfd'
make: *** [all-bfd] Error 2
Command exited with non-zero status 2
Kazu Hirata
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: PATCH: Fix bfd.c (Re: Tracking down a build breakage)
2001-08-12 4:48 ` Hans-Peter Nilsson
@ 2001-08-12 4:59 ` Hans-Peter Nilsson
0 siblings, 0 replies; 7+ messages in thread
From: Hans-Peter Nilsson @ 2001-08-12 4:59 UTC (permalink / raw)
To: Nick Clifton; +Cc: H . J . Lu, Kazu Hirata, binutils
On Sun, 12 Aug 2001, Hans-Peter Nilsson wrote:
> I don't think this is fully fixed. Please consider building
> h8300-hms and i960-coff. They don't built at the moment
Whoops. Forget about that. Pilot error. Sorry for wasting
your time.
brgds, H-P
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: PATCH: Fix bfd.c (Re: Tracking down a build breakage)
2001-08-11 15:03 ` Nick Clifton
2001-08-11 16:12 ` H . J . Lu
@ 2001-08-12 4:48 ` Hans-Peter Nilsson
2001-08-12 4:59 ` Hans-Peter Nilsson
1 sibling, 1 reply; 7+ messages in thread
From: Hans-Peter Nilsson @ 2001-08-12 4:48 UTC (permalink / raw)
To: Nick Clifton; +Cc: H . J . Lu, Kazu Hirata, binutils
On 11 Aug 2001, Nick Clifton wrote:
> > But my bfd_sprintf_vma/bfd_fprintf_vma change does break any BFD
> > which doesn't include elf.lo. It seems to me that we should only
> > check bfd_target_elf_flavour when elf is configured in BFD. Here
> > is a patch. Any comments?
>
> Ooops - I discovered this and checked in a different patch to fix
> this, without actually checking the mailing lists first. Sorry!
I don't think this is fully fixed. Please consider building
h8300-hms and i960-coff. They don't built at the moment
complaining that (mind the wrapped lines):
gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -o
size size.o bucomm.o version.o filemode.o ../bfd/.libs/libbfd.a
\
../libiberty/libiberty.a
../bfd/.libs/libbfd.a(bfd.o): In function `bfd_sprintf_vma':
/home/hp/cvs_areas/combined/cvs_write/bfd/bfd.c:1273: undefined
reference to `bfd_elf_sprintf_vma'
../bfd/.libs/libbfd.a(bfd.o): In function `bfd_fprintf_vma':
/home/hp/cvs_areas/combined/cvs_write/bfd/bfd.c:1285: undefined
reference to `bfd_elf_fprintf_vma'
collect2: ld returned 1 exit status
make[3]: *** [size] Error 1
I haven't looked into it further than this.
brgds, H-P
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: PATCH: Fix bfd.c (Re: Tracking down a build breakage)
2001-08-11 15:03 ` Nick Clifton
@ 2001-08-11 16:12 ` H . J . Lu
2001-08-12 4:48 ` Hans-Peter Nilsson
1 sibling, 0 replies; 7+ messages in thread
From: H . J . Lu @ 2001-08-11 16:12 UTC (permalink / raw)
To: Nick Clifton; +Cc: Kazu Hirata, binutils
On Sat, Aug 11, 2001 at 11:01:14PM +0100, Nick Clifton wrote:
> Hi H.J.
>
> > But my bfd_sprintf_vma/bfd_fprintf_vma change does break any BFD
> > which doesn't include elf.lo. It seems to me that we should only
> > check bfd_target_elf_flavour when elf is configured in BFD. Here
> > is a patch. Any comments?
>
> Ooops - I discovered this and checked in a different patch to fix
> this, without actually checking the mailing lists first. Sorry!
>
> Do you have any objections to the solution I used (adding new fields
> to the elf backend data structure) ?
>
No objections here.
H.J.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: PATCH: Fix bfd.c (Re: Tracking down a build breakage)
2001-08-11 10:37 ` H . J . Lu
@ 2001-08-11 15:03 ` Nick Clifton
2001-08-11 16:12 ` H . J . Lu
2001-08-12 4:48 ` Hans-Peter Nilsson
0 siblings, 2 replies; 7+ messages in thread
From: Nick Clifton @ 2001-08-11 15:03 UTC (permalink / raw)
To: H . J . Lu; +Cc: Kazu Hirata, binutils
Hi H.J.
> But my bfd_sprintf_vma/bfd_fprintf_vma change does break any BFD
> which doesn't include elf.lo. It seems to me that we should only
> check bfd_target_elf_flavour when elf is configured in BFD. Here
> is a patch. Any comments?
Ooops - I discovered this and checked in a different patch to fix
this, without actually checking the mailing lists first. Sorry!
Do you have any objections to the solution I used (adding new fields
to the elf backend data structure) ?
Cheers
Nick
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: PATCH: Fix bfd.c (Re: Tracking down a build breakage)
[not found] <E15VdGK-0005QG-00@fencepost.gnu.org>
@ 2001-08-11 11:17 ` H . J . Lu
0 siblings, 0 replies; 7+ messages in thread
From: H . J . Lu @ 2001-08-11 11:17 UTC (permalink / raw)
To: Kazu Hirata; +Cc: binutils
On Sat, Aug 11, 2001 at 02:13:28PM -0400, Kazu Hirata wrote:
> Hi,
>
> > But my bfd_sprintf_vma/bfd_fprintf_vma change does break any BFD
> > which doesn't include elf.lo. It seems to me that we should only
> > check bfd_target_elf_flavour when elf is configured in BFD. Here
> > is a patch. Any comments?
>
> This seemd to be a problem when I was trying to build gdb.
>
> > 2001-08-11 H.J. Lu <hjl@gnu.org>
> >
> > * Makefile.am (BFD_DEFINES): New. Substituted by @bfd_defines@.
> > (INCLUDES): Add $(BFD_DEFINES).
> > * Makefile.in: Regenerated.
> >
> > * configure.in (bfd_defines): Add -DHAVE_BFD_ELF if elf.lo
> > is in $bfd_backend.
> > (AC_SUBST(bfd_defines)): Added.
> > * configure: Regenerated.
> >
> > * bfd.c (bfd_sprintf_vma): Check ELF only if HAVE_BFD_ELF is
> > defined.
> > (bfd_fprintf_vma): Likewise.
>
> Amazingly, after doing "cvs co binutils", I did not have to apply your
> patch to successfully build h8300 target. With your patch, the build
> process got stuck as follows. The command line looks just fine. I
> don't know why gcc makes such a complaint...
I didn't include the patch for bfd/configure. Do
# cd ..../bfd
# autoconf
H.J.
^ permalink raw reply [flat|nested] 7+ messages in thread
* PATCH: Fix bfd.c (Re: Tracking down a build breakage)
[not found] <E15Vbrv-0003Mj-00@fencepost.gnu.org>
@ 2001-08-11 10:37 ` H . J . Lu
2001-08-11 15:03 ` Nick Clifton
0 siblings, 1 reply; 7+ messages in thread
From: H . J . Lu @ 2001-08-11 10:37 UTC (permalink / raw)
To: Kazu Hirata; +Cc: binutils, nickc
On Sat, Aug 11, 2001 at 12:44:11PM -0400, Kazu Hirata wrote:
> Hi,
>
> I recently reported to bug-binutils that the h8300 port had a build
> breakage.
>
> http://sources.redhat.com/ml/bug-binutils/2001-q3/msg00057.html
>
You have an incomplete source. I use
# cvs co binutils
to update my CVS tree.
But my bfd_sprintf_vma/bfd_fprintf_vma change does break any BFD
which doesn't include elf.lo. It seems to me that we should only
check bfd_target_elf_flavour when elf is configured in BFD. Here
is a patch. Any comments?
H.J.
-----
2001-08-11 H.J. Lu <hjl@gnu.org>
* Makefile.am (BFD_DEFINES): New. Substituted by @bfd_defines@.
(INCLUDES): Add $(BFD_DEFINES).
* Makefile.in: Regenerated.
* configure.in (bfd_defines): Add -DHAVE_BFD_ELF if elf.lo
is in $bfd_backend.
(AC_SUBST(bfd_defines)): Added.
* configure: Regenerated.
* bfd.c (bfd_sprintf_vma): Check ELF only if HAVE_BFD_ELF is
defined.
(bfd_fprintf_vma): Likewise.
Index: bfd.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/bfd.c,v
retrieving revision 1.1.1.13
diff -u -p -r1.1.1.13 bfd.c
--- bfd.c 2001/08/10 18:46:20 1.1.1.13
+++ bfd.c 2001/08/11 17:26:22
@@ -1265,24 +1265,28 @@ bfd_record_phdr (abfd, type, flags_valid
void
bfd_sprintf_vma (abfd, buf, value)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
char *buf;
bfd_vma value;
{
+#ifdef HAVE_BFD_ELF
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
bfd_elf_sprintf_vma (abfd, buf, value);
else
+#endif
sprintf_vma (buf, value);
}
void
bfd_fprintf_vma (abfd, stream, value)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
PTR stream;
bfd_vma value;
{
+#ifdef HAVE_BFD_ELF
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
bfd_elf_fprintf_vma (abfd, stream, value);
else
+#endif
fprintf_vma ((FILE *) stream, value);
}
Index: Makefile.am
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/Makefile.am,v
retrieving revision 1.47
diff -u -p -r1.47 Makefile.am
--- Makefile.am 2001/07/24 16:33:47 1.47
+++ Makefile.am 2001/08/11 17:26:23
@@ -475,9 +475,12 @@ WORDSIZE = @wordsize@
ALL_BACKENDS = @all_backends@
BFD_BACKENDS = @bfd_backends@
BFD_MACHINES = @bfd_machines@
+BFD_DEFINES = @bfd_defines@
TDEFAULTS = @tdefaults@
-INCLUDES = -D_GNU_SOURCE @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES) -I$(srcdir)/../intl -I../intl
+INCLUDES = -D_GNU_SOURCE @HDEFINES@ @COREFLAG@ @TDEFINES@ \
+ $(BFD_DEFINES) $(CSEARCH) $(CSWITCHES) \
+ -I$(srcdir)/../intl -I../intl
# C source files that correspond to .o's.
SOURCE_CFILES = \
Index: Makefile.in
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/Makefile.in,v
retrieving revision 1.54
diff -u -p -r1.54 Makefile.in
--- Makefile.in 2001/07/24 16:33:48 1.54
+++ Makefile.in 2001/08/11 17:26:23
@@ -114,6 +114,7 @@ WIN32LDFLAGS = @WIN32LDFLAGS@
WIN32LIBADD = @WIN32LIBADD@
all_backends = @all_backends@
bfd_backends = @bfd_backends@
+bfd_defines = @bfd_defines@
bfd_machines = @bfd_machines@
l = @l@
tdefaults = @tdefaults@
@@ -604,10 +605,14 @@ WORDSIZE = @wordsize@
ALL_BACKENDS = @all_backends@
BFD_BACKENDS = @bfd_backends@
BFD_MACHINES = @bfd_machines@
+BFD_DEFINES = @bfd_defines@
TDEFAULTS = @tdefaults@
-INCLUDES = -D_GNU_SOURCE @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES) -I$(srcdir)/../intl -I../intl
+INCLUDES = -D_GNU_SOURCE @HDEFINES@ @COREFLAG@ @TDEFINES@ \
+ $(BFD_DEFINES) $(CSEARCH) $(CSWITCHES) \
+ -I$(srcdir)/../intl -I../intl
+
# C source files that correspond to .o's.
SOURCE_CFILES = \
$(BFD_LIBS_CFILES) \
Index: configure.in
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/configure.in,v
retrieving revision 1.165
diff -u -p -r1.165 configure.in
--- configure.in 2001/08/10 17:03:21 1.165
+++ configure.in 2001/08/11 17:26:23
@@ -128,6 +128,8 @@ BFD_NEED_DECLARATION(realloc)
BFD_NEED_DECLARATION(free)
BFD_NEED_DECLARATION(getenv)
+bfd_defines=
+
# If we are configured native, pick a core file support file.
COREFILE=
COREFLAG=
@@ -702,6 +704,12 @@ ta="$f"
bfd_backends="$tb"
bfd_machines="$ta"
+case "$bfd_backends" in
+*elf.lo*)
+ bfd_defines="$bfd_defines -DHAVE_BFD_ELF"
+ ;;
+esac
+
if test x${all_targets} = xtrue ; then
bfd_backends="${bfd_backends}"' $(ALL_BACKENDS)'
bfd_machines="${bfd_machines}"' $(ALL_MACHINES)'
@@ -738,6 +746,7 @@ AC_SUBST(wordsize)
AC_SUBST(all_backends)
AC_SUBST(bfd_backends)
AC_SUBST(bfd_machines)
+AC_SUBST(bfd_defines)
tdefaults=""
test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}"
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2001-08-12 4:59 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-11 11:13 PATCH: Fix bfd.c (Re: Tracking down a build breakage) Kazu Hirata
[not found] <E15VdGK-0005QG-00@fencepost.gnu.org>
2001-08-11 11:17 ` H . J . Lu
[not found] <E15Vbrv-0003Mj-00@fencepost.gnu.org>
2001-08-11 10:37 ` H . J . Lu
2001-08-11 15:03 ` Nick Clifton
2001-08-11 16:12 ` H . J . Lu
2001-08-12 4:48 ` Hans-Peter Nilsson
2001-08-12 4:59 ` Hans-Peter Nilsson
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).