* RE: [PATCH] kconfig: detect if -lintl is needed when linking conf,mconf
@ 2006-02-09 17:24 Robb, Sam
2006-02-14 16:13 ` Christopher Faylor
0 siblings, 1 reply; 5+ messages in thread
From: Robb, Sam @ 2006-02-09 17:24 UTC (permalink / raw)
To: Kyle McMartin; +Cc: akpm, Sam Ravnborg, zippel, linux-kernel
Kyle McMartin <kyle@parisc-linux.org> wrote:
> On Mon, Jan 30, 2006 at 01:26:47PM -0500, Robb, Sam wrote:
> > This patch attempts to correct the problem by detecting whether or not
> > NLS support requires linking with libintl.
> >
>
> Sigh. Can everyone please stop assuming gcc can output to /dev/null? On
> several platforms, ld tries to lseek in the output file, and fails if it
> can't.
Ouch. Out of curiosity - what is the reason for this behavior in ld?
> Is there any reason this problem can't be solved the same way it is
> for libcurses in menuconfig, by using gcc -print-filename? Or perhaps
> using tempfile?
Using -print-file-name may cause problems if a system has libintl installed,
and the C library provides libintl support as well - you end up detecting
libintl, but linking to it isn't a good idea in that case. Not to mention
figuring out which libintl to link to - static lib? .so? .dll (cygwin)?
Using a tempfile sounds like the right solution - you want to detect if
linking with -lintl is absolutely required, not just if the library exists.
Sam Ravenborg mentioned reimplementing this using check-lxdialog.sh. I'll
wait and see what comes of that.
BTW - many thanks to all the folks who looked at this (admittedly trivial)
patch. There's a level of professionalism and attention to detail in the
Linux community that's very refrehing.
-Samrobb
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] kconfig: detect if -lintl is needed when linking conf,mconf
2006-02-09 17:24 [PATCH] kconfig: detect if -lintl is needed when linking conf,mconf Robb, Sam
@ 2006-02-14 16:13 ` Christopher Faylor
0 siblings, 0 replies; 5+ messages in thread
From: Christopher Faylor @ 2006-02-14 16:13 UTC (permalink / raw)
To: linux-kernel, Robb, Sam, Sam Ravnborg, zippel, akpm, Kyle McMartin
On Thu, Feb 09, 2006 at 12:24:12PM -0500, Robb, Sam wrote:
>Kyle McMartin <kyle@parisc-linux.org> wrote:
>>On Mon, Jan 30, 2006 at 01:26:47PM -0500, Robb, Sam wrote:
>>> This patch attempts to correct the problem by detecting whether or not
>>> NLS support requires linking with libintl.
>>
>>Sigh. Can everyone please stop assuming gcc can output to /dev/null? On
>>several platforms, ld tries to lseek in the output file, and fails if it
>>can't.
>
>Ouch. Out of curiosity - what is the reason for this behavior in ld?
Ouch, indeed.
I'd be interested in details on which platforms perform so lamely. When
I grep for lseek and its variants in the bfd and ld source code, the only
occurrences that I see are all working on object files - as I would expect.
-Chris Faylor
(one of the) binutils maintainers
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] kconfig: detect if -lintl is needed when linking conf,mconf
@ 2006-01-30 18:26 Robb, Sam
2006-02-09 5:42 ` Kyle McMartin
0 siblings, 1 reply; 5+ messages in thread
From: Robb, Sam @ 2006-01-30 18:26 UTC (permalink / raw)
To: zippel; +Cc: linux-kernel
Hello,
On a system where libintl.h is present, but the NLS functionality is
supplied by a separate library instead of the system C library, an attempt
to "make config" or "make menuconfig" will fail with link errors, ex:
scripts/kconfig/mconf.o:mconf.c:(.text+0xf63): undefined reference to
`_libintl_gettext'
This patch attempts to correct the problem by detecting whether or not
NLS support requires linking with libintl.
Signed-off-by: Samuel J Robb <sam.robb@timesys.com>
---
--- linux-2.6.15.1/scripts/kconfig/Makefile.orig 2006-01-25 14:55:22.926372900 -0500
+++ linux-2.6.15.1/scripts/kconfig/Makefile 2006-01-30 12:51:04.551596200 -0500
@@ -122,7 +122,17 @@ KBUILD_HAVE_NLS := $(shell \
then echo yes ; \
else echo no ; fi)
ifeq ($(KBUILD_HAVE_NLS),no)
-HOSTCFLAGS += -DKBUILD_NO_NLS
+ HOSTCFLAGS += -DKBUILD_NO_NLS
+else
+ KBUILD_NEED_LINTL := $(shell \
+ if echo -e "\#include <libintl.h>\nint main(int a, char** b) { gettext(\"\"); return 0; }\n" | \
+ $(HOSTCC) $(HOSTCFLAGS) -x c - > /dev/null 2>&1 ; \
+ then echo no ; \
+ else echo yes ; fi)
+ ifeq ($(KBUILD_NEED_LINTL),yes)
+ HOSTLOADLIBES_conf += -lintl
+ HOSTLOADLIBES_mconf += -lintl
+ endif
endif
# generated files seem to need this to find local include files
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] kconfig: detect if -lintl is needed when linking conf,mconf
2006-01-30 18:26 Robb, Sam
@ 2006-02-09 5:42 ` Kyle McMartin
2006-02-09 5:57 ` Andrew Morton
0 siblings, 1 reply; 5+ messages in thread
From: Kyle McMartin @ 2006-02-09 5:42 UTC (permalink / raw)
To: Robb, Sam; +Cc: akpm, zippel, linux-kernel
On Mon, Jan 30, 2006 at 01:26:47PM -0500, Robb, Sam wrote:
> This patch attempts to correct the problem by detecting whether or not
> NLS support requires linking with libintl.
>
Sigh. Can everyone please stop assuming gcc can output to /dev/null? On
several platforms, ld tries to lseek in the output file, and fails if it
can't.
Is there any reason this problem can't be solved the same way it is
for libcurses in menuconfig, by using gcc -print-filename? Or perhaps
using tempfile?
Cheers,
Kyle
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] kconfig: detect if -lintl is needed when linking conf,mconf
2006-02-09 5:42 ` Kyle McMartin
@ 2006-02-09 5:57 ` Andrew Morton
0 siblings, 0 replies; 5+ messages in thread
From: Andrew Morton @ 2006-02-09 5:57 UTC (permalink / raw)
To: Kyle McMartin; +Cc: sam.robb, zippel, linux-kernel, Linus Torvalds
Kyle McMartin <kyle@parisc-linux.org> wrote:
>
> On Mon, Jan 30, 2006 at 01:26:47PM -0500, Robb, Sam wrote:
> > This patch attempts to correct the problem by detecting whether or not
> > NLS support requires linking with libintl.
> >
>
> Sigh. Can everyone please stop assuming gcc can output to /dev/null? On
> several platforms, ld tries to lseek in the output file, and fails if it
> can't.
Ah.
> Is there any reason this problem can't be solved the same way it is
> for libcurses in menuconfig, by using gcc -print-filename? Or perhaps
> using tempfile?
Sam has plans to address this problem I guess we should drop that patch.
Linus, please nuke 5e375bc7d586e0df971734a5a5f1f080ffd89b68
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-02-14 16:13 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-09 17:24 [PATCH] kconfig: detect if -lintl is needed when linking conf,mconf Robb, Sam
2006-02-14 16:13 ` Christopher Faylor
-- strict thread matches above, loose matches on Subject: below --
2006-01-30 18:26 Robb, Sam
2006-02-09 5:42 ` Kyle McMartin
2006-02-09 5:57 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®