linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* PATCH: use CFLAGS when linking always
@ 2007-05-05 14:20 Dennis Gilmore
  2007-05-05 19:26 ` Theodore Tso
  0 siblings, 1 reply; 4+ messages in thread
From: Dennis Gilmore @ 2007-05-05 14:20 UTC (permalink / raw)
  To: linux-ext4


[-- Attachment #1.1: Type: text/plain, Size: 287 bytes --]

for multilib archs default CFLAGS may be inappropriate  and reslut in binaries 
unable to be linked.  since e2fsprogs uses gcc for linking I noticed this 
while building for sparc64.  patch has been tested and applied in Aurora 
SPARC Linux. 

Please CC me on responses.

Dennis

[-- Attachment #1.2: e2fsprogs-1.39-useCFLAGSwithCC.patch --]
[-- Type: text/x-diff, Size: 4230 bytes --]

--- e2fsprogs-1.39/configure.BAD	2006-07-11 20:21:08.000000000 -0400
+++ e2fsprogs-1.39/configure	2006-07-11 20:21:17.000000000 -0400
@@ -14645,7 +14645,7 @@
 
 if test $cross_compiling = no; then
    BUILD_CFLAGS="$CFLAGS"
-   BUILD_LDFLAGS="$LDFLAGS"
+   BUILD_LDFLAGS="$CFLAGS $LDFLAGS"
 else
    BUILD_CFLAGS=
    BUILD_LDFLAGS=
--- e2fsprogs-1.39/configure.in.BAD	2006-07-11 20:27:02.000000000 -0400
+++ e2fsprogs-1.39/configure.in	2006-07-11 20:27:09.000000000 -0400
@@ -830,7 +830,7 @@
 dnl
 if test $cross_compiling = no; then
    BUILD_CFLAGS="$CFLAGS"
-   BUILD_LDFLAGS="$LDFLAGS"
+   BUILD_LDFLAGS="$CFLAGS $LDFLAGS"
 else
    BUILD_CFLAGS=
    BUILD_LDFLAGS=
--- e2fsprogs-1.39/lib/Makefile.elf-lib.BAD	2006-07-12 10:43:02.000000000 -0400
+++ e2fsprogs-1.39/lib/Makefile.elf-lib	2006-07-12 10:43:12.000000000 -0400
@@ -24,7 +24,7 @@
 
 $(ELF_LIB): $(OBJS)
 	@echo "	GEN_ELF_SOLIB $(ELF_LIB)"
-	@(cd elfshared; $(CC) --shared -o $(ELF_LIB) $(LDFLAGS) \
+	@(cd elfshared; $(CC) $(CFLAGS) --shared -o $(ELF_LIB) $(LDFLAGS) \
 		-Wl,-soname,$(ELF_SONAME) $(OBJS) $(ELF_OTHER_LIBS))
 	@$(MV) elfshared/$(ELF_LIB) .
 	@$(RM) -f ../$(ELF_LIB) ../$(ELF_IMAGE).so ../$(ELF_SONAME)
--- e2fsprogs-1.39/MCONFIG.in.BAD	2006-07-12 12:10:33.000000000 -0400
+++ e2fsprogs-1.39/MCONFIG.in	2006-07-12 12:10:42.000000000 -0400
@@ -40,7 +40,7 @@
 ALL_CFLAGS = $(CPPFLAGS) $(DEFS) $(USE_WFLAGS) $(CFLAGS) $(XTRA_CFLAGS) \
 	$(INTL_FLAGS) $(LINUX_INCLUDE) 
 LDFLAGS = @LDFLAGS@
-ALL_LDFLAGS = $(LDFLAGS)
+ALL_LDFLAGS = $(LDFLAGS) $(CFLAGS)
 BUILD_CFLAGS = @BUILD_CFLAGS@
 BUILD_LDFLAGS = @BUILD_LDFLAGS@
 RM = @RM@
--- e2fsprogs-1.39/lib/ext2fs/Makefile.in.BAD	2006-07-12 12:41:09.000000000 -0400
+++ e2fsprogs-1.39/lib/ext2fs/Makefile.in	2006-07-12 12:44:14.000000000 -0400
@@ -189,17 +189,17 @@
 	@echo "	LD $@"
 	@$(CC) -o tst_badblocks tst_badblocks.o freefs.o \
 		read_bb_file.o write_bb_file.o badblocks.o \
-		inline.o bitops.o gen_bitmap.o $(LIBCOM_ERR)
+		inline.o bitops.o gen_bitmap.o $(ALL_CFLAGS) $(LIBCOM_ERR)
 
 tst_iscan: tst_iscan.o inode.o badblocks.o test_io.o $(STATIC_LIBEXT2FS)
 	@echo "	LD $@"
 	@$(CC) -o tst_iscan tst_iscan.o inode.o badblocks.o test_io.o \
-		$(STATIC_LIBEXT2FS) $(LIBCOM_ERR)
+		$(ALL_CFLAGS) $(STATIC_LIBEXT2FS) $(LIBCOM_ERR)
 
 tst_getsize: tst_getsize.o getsize.o $(STATIC_LIBEXT2FS)
 	@echo "	LD $@"
-	@$(CC) -o tst_getsize tst_getsize.o getsize.o $(STATIC_LIBEXT2FS) \
-		$(LIBCOM_ERR)
+	@$(CC) -o tst_getsize tst_getsize.o getsize.o $(ALL_CFLAGS) \
+		$(STATIC_LIBEXT2FS) $(LIBCOM_ERR)
 
 tst_ismounted: $(srcdir)/ismounted.c $(STATIC_LIBEXT2FS)
 	@echo "	LD $@"
@@ -207,8 +207,8 @@
 
 tst_byteswap: tst_byteswap.o bitops.o $(STATIC_LIBEXT2FS)
 	@echo "	LD $@"
-	@$(CC) -o tst_byteswap tst_byteswap.o bitops.o $(STATIC_LIBEXT2FS) \
-		$(LIBCOM_ERR)
+	@$(CC) -o tst_byteswap tst_byteswap.o bitops.o $(ALL_CFLAGS) \
+		$(STATIC_LIBEXT2FS) $(LIBCOM_ERR)
 
 tst_bitops: tst_bitops.o inline.o $(STATIC_LIBEXT2FS)
 	@echo "	LD $@"
@@ -218,11 +218,11 @@
 tst_getsectsize: tst_getsectsize.o getsectsize.o $(STATIC_LIBEXT2FS)
 	@echo "	LD $@"
 	@$(CC) -o tst_sectgetsize tst_getsectsize.o getsectsize.o \
-		$(STATIC_LIBEXT2FS) $(LIBCOM_ERR)
+		$(ALL_CFLAGS) $(STATIC_LIBEXT2FS) $(LIBCOM_ERR)
 
 tst_types: tst_types.o ext2_types.h 
 	@echo "	LD $@"
-	@$(CC) -o tst_types tst_types.o 
+	@$(CC) -o tst_types tst_types.o $(ALL_CFLAGS) 
 
 mkjournal: mkjournal.c $(STATIC_LIBEXT2FS)
 	@echo "	LD $@"
--- e2fsprogs-1.39/lib/blkid/Makefile.in.BAD	2006-07-12 14:03:13.000000000 -0400
+++ e2fsprogs-1.39/lib/blkid/Makefile.in	2006-07-12 14:04:31.000000000 -0400
@@ -114,7 +114,7 @@
 
 tst_types: tst_types.o blkid_types.h 
 	@echo "	LD $@"
-	@$(CC) -o tst_types tst_types.o 
+	@$(CC) -o tst_types tst_types.o $(ALL_CFLAGS)
 
 ../../misc/blkid.o: $(top_srcdir)/misc/blkid.c blkid.h
 	@echo "	CC $@"
@@ -123,7 +123,7 @@
 
 blkid: ../../misc/blkid.o libblkid.a $(DEPLIBUUID)
 	@echo "	LD $@"
-	@$(CC) -o blkid ../../misc/blkid.o libblkid.a $(LIBUUID)
+	@$(CC) -o blkid ../../misc/blkid.o libblkid.a $(LIBUUID) $(ALL_CFLAGS)
 
 test_probe: test_probe.in Makefile
 	@echo "Creating test_probe..."

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: PATCH: use CFLAGS when linking always
  2007-05-05 14:20 PATCH: use CFLAGS when linking always Dennis Gilmore
@ 2007-05-05 19:26 ` Theodore Tso
  2007-05-06  3:06   ` Dennis Gilmore
  0 siblings, 1 reply; 4+ messages in thread
From: Theodore Tso @ 2007-05-05 19:26 UTC (permalink / raw)
  To: Dennis Gilmore; +Cc: linux-ext4

On Sat, May 05, 2007 at 09:20:47AM -0500, Dennis Gilmore wrote:
> for multilib archs default CFLAGS may be inappropriate  and reslut in binaries 
> unable to be linked.  since e2fsprogs uses gcc for linking I noticed this 
> while building for sparc64.  patch has been tested and applied in Aurora 
> SPARC Linux. 

What options do you need, and why don't you just specify them via:

configure --with-ldopts="--foo-ld-flag"

					- Ted

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

* Re: PATCH: use CFLAGS when linking always
  2007-05-05 19:26 ` Theodore Tso
@ 2007-05-06  3:06   ` Dennis Gilmore
  2007-05-06 13:54     ` Theodore Tso
  0 siblings, 1 reply; 4+ messages in thread
From: Dennis Gilmore @ 2007-05-06  3:06 UTC (permalink / raw)
  To: Theodore Tso; +Cc: linux-ext4

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

Once upon a time Saturday 05 May 2007, Theodore Tso wrote:
> On Sat, May 05, 2007 at 09:20:47AM -0500, Dennis Gilmore wrote:
> > for multilib archs default CFLAGS may be inappropriate  and reslut in
> > binaries unable to be linked.  since e2fsprogs uses gcc for linking I
> > noticed this while building for sparc64.  patch has been tested and
> > applied in Aurora SPARC Linux.
>
> What options do you need, and why don't you just specify them via:
>
> configure --with-ldopts="--foo-ld-flag"
>
> 					- Ted

defaults on sparc64  result in 64 bit objects  but gcc trying to create a 32 
bit binary.  as a result the build blows up horribly.  the patch ensures that 
CFLAGS is used in linking.  since gcc is used to link it is needed.

Dennis

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: PATCH: use CFLAGS when linking always
  2007-05-06  3:06   ` Dennis Gilmore
@ 2007-05-06 13:54     ` Theodore Tso
  0 siblings, 0 replies; 4+ messages in thread
From: Theodore Tso @ 2007-05-06 13:54 UTC (permalink / raw)
  To: Dennis Gilmore; +Cc: linux-ext4

On Sat, May 05, 2007 at 10:06:01PM -0500, Dennis Gilmore wrote:
> Once upon a time Saturday 05 May 2007, Theodore Tso wrote:
> > On Sat, May 05, 2007 at 09:20:47AM -0500, Dennis Gilmore wrote:
> > > for multilib archs default CFLAGS may be inappropriate  and reslut in
> > > binaries unable to be linked.  since e2fsprogs uses gcc for linking I
> > > noticed this while building for sparc64.  patch has been tested and
> > > applied in Aurora SPARC Linux.
> >
> > What options do you need, and why don't you just specify them via:
> >
> > configure --with-ldopts="--foo-ld-flag"
> >
> > 					- Ted
> 
> defaults on sparc64  result in 64 bit objects  but gcc trying to create a 32 
> bit binary.  as a result the build blows up horribly.  the patch ensures that 
> CFLAGS is used in linking.  since gcc is used to link it is needed.
> 

What CFLAGS are you passing to configure, exactly?  And why can't you
also pass them to configure via --with-ldopts?

						- Ted

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

end of thread, other threads:[~2007-05-06 13:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-05 14:20 PATCH: use CFLAGS when linking always Dennis Gilmore
2007-05-05 19:26 ` Theodore Tso
2007-05-06  3:06   ` Dennis Gilmore
2007-05-06 13:54     ` Theodore Tso

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 NNTP newsgroup(s).