From: Dennis Gilmore <dennis@ausil.us>
To: linux-ext4@vger.kernel.org
Subject: PATCH: use CFLAGS when linking always
Date: Sat, 5 May 2007 09:20:47 -0500 [thread overview]
Message-ID: <200705050920.56558.dennis@ausil.us> (raw)
[-- 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 --]
next reply other threads:[~2007-05-05 16:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-05 14:20 Dennis Gilmore [this message]
2007-05-05 19:26 ` PATCH: use CFLAGS when linking always Theodore Tso
2007-05-06 3:06 ` Dennis Gilmore
2007-05-06 13:54 ` Theodore Tso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200705050920.56558.dennis@ausil.us \
--to=dennis@ausil.us \
--cc=linux-ext4@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).