* ELF options may be missing from `ld --help' output after migration to ld_list_options
@ 2015-04-10 8:05 Ilya Malakhov
2015-04-10 8:55 ` Alan Modra
0 siblings, 1 reply; 4+ messages in thread
From: Ilya Malakhov @ 2015-04-10 8:05 UTC (permalink / raw)
To: binutils; +Cc: hjl.tools
Hi,
One should probably check whether to set elf_list_options and others to TRUE
in `*)' case rather than in `*" e${i}.o "*)' one within ld/configure.ac in
master branch of binutils-gdb.git:
. . .
for i in $targ_emul $targ_extra_emuls $targ_extra_libpath; do
case " $all_emuls " in
*" e${i}.o "*)
case "${i}" in
*elf*)
elf_list_options=TRUE
. ${srcdir}/emulparams/${i}.sh
if test x${GENERATE_SHLIB_SCRIPT} = xyes; then
elf_shlib_list_options=TRUE
fi
if test x${PLT_UNWIND} = xyes; then
elf_plt_unwind_list_options=TRUE
fi
;;
esac
;;
*)
all_emuls="$all_emuls e${i}.o"
eval result=\$tdir_$i
test -z "$result" && result=$targ_alias
echo tdir_$i=$result >> tdirs
;;
esac
done
. . .
Currently one may very well stay with these variables unreasonably set to FALSE
unless an elf emulation is met several times within the `$targ_emul
$targ_extra_emuls $targ_extra_libpath' list. This breaks a glibc build with
upstream binutils since a number of important ELF-specific options checked for
at `glibc/configure' stage are missing from `ld -v --help' output.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: ELF options may be missing from `ld --help' output after migration to ld_list_options
2015-04-10 8:05 ELF options may be missing from `ld --help' output after migration to ld_list_options Ilya Malakhov
@ 2015-04-10 8:55 ` Alan Modra
2015-05-14 10:41 ` Chung-Lin Tang
0 siblings, 1 reply; 4+ messages in thread
From: Alan Modra @ 2015-04-10 8:55 UTC (permalink / raw)
To: Ilya Malakhov; +Cc: binutils, hjl.tools
On Fri, Apr 10, 2015 at 11:05:45AM +0300, Ilya Malakhov wrote:
> One should probably check whether to set elf_list_options and others to TRUE
> in `*)' case rather than in `*" e${i}.o "*)' one within ld/configure.ac in
> master branch of binutils-gdb.git:
Indeed. Thanks!
* configure.ac: Set elf_list_options etc. in proper case.
* configure: Regenerate.
diff --git a/ld/configure.ac b/ld/configure.ac
index ac3c14f..e120a05 100644
--- a/ld/configure.ac
+++ b/ld/configure.ac
@@ -317,7 +317,12 @@ do
for i in $targ_emul $targ_extra_emuls $targ_extra_libpath; do
case " $all_emuls " in
- *" e${i}.o "*)
+ *" e${i}.o "*) ;;
+ *)
+ all_emuls="$all_emuls e${i}.o"
+ eval result=\$tdir_$i
+ test -z "$result" && result=$targ_alias
+ echo tdir_$i=$result >> tdirs
case "${i}" in
*elf*)
elf_list_options=TRUE
@@ -331,12 +336,6 @@ do
;;
esac
;;
- *)
- all_emuls="$all_emuls e${i}.o"
- eval result=\$tdir_$i
- test -z "$result" && result=$targ_alias
- echo tdir_$i=$result >> tdirs
- ;;
esac
done
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: ELF options may be missing from `ld --help' output after migration to ld_list_options
2015-04-10 8:55 ` Alan Modra
@ 2015-05-14 10:41 ` Chung-Lin Tang
2015-05-17 4:57 ` Alan Modra
0 siblings, 1 reply; 4+ messages in thread
From: Chung-Lin Tang @ 2015-05-14 10:41 UTC (permalink / raw)
To: Ilya Malakhov, binutils, hjl.tools; +Cc: Sandra Loosemore
[-- Attachment #1: Type: text/plain, Size: 1508 bytes --]
On 15/4/10 4:54 PM, Alan Modra wrote:
> On Fri, Apr 10, 2015 at 11:05:45AM +0300, Ilya Malakhov wrote:
>> One should probably check whether to set elf_list_options and others to TRUE
>> in `*)' case rather than in `*" e${i}.o "*)' one within ld/configure.ac in
>> master branch of binutils-gdb.git:
>
> Indeed. Thanks!
>
> * configure.ac: Set elf_list_options etc. in proper case.
> * configure: Regenerate.
I have another case that needs fixing related to ld_list_options.
nios2-linux has an emulation named "nios2linux", and happens to not include
another extra emulation with a name matching *elf*. This makes nios2-linux
left out of the ELF options printing targets, which is unintended.
The name of emulation didn't play this part when I created "nios2linux" from
"nios2elf", so this is a recent breakage (glibc configure failed for me too :P).
I can change the emulation name to something like "nios2elf_linux" if required,
but may I suggest that configuration uses emulparams/*.sh contents too?
The attached patch also enables the ELF options when "TEMPLATE_NAME=elf32" is
found inside the emulparams file as well. This should make things more robust.
Thanks,
Chung-Lin
2015-05-14 Chung-Lin Tang <cltang@codesourcery.com>
* configure.ac (AC_PROG_GREP): Check for grep program.
(elf_list_options,elf_shlib_list_options,elf_plt_unwind_list_options):
Enable ELF option printing for emulations containing 'TEMPLATE_NAME=elf32'.
* configure: Regenerate.
[-- Attachment #2: ld-config.patch --]
[-- Type: text/x-patch, Size: 938 bytes --]
diff --git a/ld/configure.ac b/ld/configure.ac
index e120a05..54bfb86 100644
--- a/ld/configure.ac
+++ b/ld/configure.ac
@@ -31,6 +31,7 @@ AM_MAINTAINER_MODE
AC_PROG_CC
AC_PROG_CXX
+AC_PROG_GREP
AC_GNU_SOURCE
AC_USE_SYSTEM_EXTENSIONS
AC_PROG_INSTALL
@@ -324,8 +325,14 @@ do
test -z "$result" && result=$targ_alias
echo tdir_$i=$result >> tdirs
case "${i}" in
- *elf*)
- elf_list_options=TRUE
+ *elf*) elf_list_options=TRUE ;;
+ *)
+ if test `$GREP "TEMPLATE_NAME=elf32" ${srcdir}/emulparams/${i}.sh`; then
+ elf_list_options=TRUE
+ fi
+ ;;
+ esac
+ if test "$elf_list_options" = "TRUE"; then
. ${srcdir}/emulparams/${i}.sh
if test x${GENERATE_SHLIB_SCRIPT} = xyes; then
elf_shlib_list_options=TRUE
@@ -333,8 +340,7 @@ do
if test x${PLT_UNWIND} = xyes; then
elf_plt_unwind_list_options=TRUE
fi
- ;;
- esac
+ fi
;;
esac
done
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: ELF options may be missing from `ld --help' output after migration to ld_list_options
2015-05-14 10:41 ` Chung-Lin Tang
@ 2015-05-17 4:57 ` Alan Modra
0 siblings, 0 replies; 4+ messages in thread
From: Alan Modra @ 2015-05-17 4:57 UTC (permalink / raw)
To: Chung-Lin Tang; +Cc: Ilya Malakhov, binutils, hjl.tools, Sandra Loosemore
On Thu, May 14, 2015 at 06:40:57PM +0800, Chung-Lin Tang wrote:
> * configure.ac (AC_PROG_GREP): Check for grep program.
> (elf_list_options,elf_shlib_list_options,elf_plt_unwind_list_options):
> Enable ELF option printing for emulations containing 'TEMPLATE_NAME=elf32'.
> * configure: Regenerate.
Thanks! I've applied this with a few small tweaks. Other targets,
eg. hppa-linux, need this too.
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-05-17 4:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-10 8:05 ELF options may be missing from `ld --help' output after migration to ld_list_options Ilya Malakhov
2015-04-10 8:55 ` Alan Modra
2015-05-14 10:41 ` Chung-Lin Tang
2015-05-17 4:57 ` Alan Modra
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).