[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
prefix-args mangles LDFLAGS
From: |
Paul Jarc |
Subject: |
prefix-args mangles LDFLAGS |
Date: |
Fri, 30 Aug 2002 18:59:04 -0400 |
User-agent: |
Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i686-pc-linux-gnu) |
I posted something about this a while ago, but it never showed up.
I'm addressing systems where LD in src/Makefile is not defined as ld.
When building temacs, src/Makefile.in passes LDFLAGS to prefix-args
via ALL_LDFLAGS. So it is presuming that LDFLAGS contains flags which
should be passed directly to ld, and must be escaped with -Xlinker if
they are to be passed to cc. But other rules - e.g., the rule to
build prefix-args - pass LDFLAGS to $(CC). So they presume that
LDFLAGS should be passed *indirectly* to ld, via cc. This means that
LDFLAGS can only be used for options that are recognized by both cc
and ld, which is inconvenient.
If instead LDFLAGS were not subjected to transformation by
prefix-args, then it would always be passed to cc, and so users could
pass any flags at all as long as they take care of the escaping
themselves.
On systems where LD=ld, prefix-args is not used, but LDFLAGS is still
passed to both ld and cc. I'm not sure what would be the best way to
fix this for those systems.
--- emacs-21.2/src/Makefile.in.orig 2001-12-17 09:09:10.000000000 -0500
+++ emacs-21.2/src/Makefile.in 2002-08-30 18:49:31.000000000 -0400
@@ -495,7 +495,7 @@
#endif /* not ORDINARY_LINK */
ALL_LDFLAGS = LD_SWITCH_SYSTEM LD_SWITCH_SYSTEM_TEMACS LD_SWITCH_MACHINE \
- LD_SWITCH_MACHINE_TEMACS LD_SWITCH_SITE $(LDFLAGS)
+ LD_SWITCH_MACHINE_TEMACS LD_SWITCH_SITE
/* A macro which other sections of Makefile can redefine to munge the
flags before they're passed to LD. This is helpful if you have
@@ -868,7 +868,7 @@
#endif
temacs: MAKE_PARALLEL $(LOCALCPP) $(STARTFILES) stamp-oldxmenu ${obj}
${otherobj} OBJECTS_MACHINE prefix-args
- $(LD) YMF_PASS_LDFLAGS (${STARTFLAGS} ${ALL_LDFLAGS}) \
+ $(LD) YMF_PASS_LDFLAGS (${STARTFLAGS} ${ALL_LDFLAGS}) $(LDFLAGS) \
-o temacs ${STARTFILES} ${obj} ${otherobj} \
OBJECTS_MACHINE ${LIBES}
paul
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- prefix-args mangles LDFLAGS,
Paul Jarc <=