public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][AArch64] elf toolchain does not pass -shared linker option
@ 2015-07-22 17:33 Szabolcs Nagy
  2015-07-24 13:46 ` Marcus Shawcroft
  0 siblings, 1 reply; 4+ messages in thread
From: Szabolcs Nagy @ 2015-07-22 17:33 UTC (permalink / raw)
  To: gcc-patches; +Cc: Marcus Shawcroft

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

Valid linker options should be treated for elf consistently
with the linux-gnu target.

I'm not sure about the undocumented -h option (blindly copied
LINUX_TARGET_LINK_SPEC from aarch64-linux without the
dynamic-linker flag).

(Not passing -shared can cause broken vdso.so in the linux
kernel when it is built with the elf toolchain.)

2015-07-22  Szabolcs Nagy  <szabolcs.nagy@arm.com>

	* config/aarch64/aarch64-elf-raw.h (LINK_SPEC): Handle -h, -static,
	-shared, -symbolic, -rdynamic.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: elf-link-spec-2.diff --]
[-- Type: text/x-patch; name=elf-link-spec-2.diff, Size: 650 bytes --]

diff --git a/gcc/config/aarch64/aarch64-elf-raw.h b/gcc/config/aarch64/aarch64-elf-raw.h
index bd5e51c..d8c682f 100644
--- a/gcc/config/aarch64/aarch64-elf-raw.h
+++ b/gcc/config/aarch64/aarch64-elf-raw.h
@@ -44,7 +44,12 @@
 #endif
 
 #ifndef LINK_SPEC
-#define LINK_SPEC "%{mbig-endian:-EB} %{mlittle-endian:-EL} -X \
+#define LINK_SPEC "%{h*}			\
+   %{static:-Bstatic}				\
+   %{shared:-shared}				\
+   %{symbolic:-Bsymbolic}			\
+   %{!static:%{rdynamic:-export-dynamic}}	\
+   %{mbig-endian:-EB} %{mlittle-endian:-EL} -X	\
   -maarch64elf%{mabi=ilp32*:32}%{mbig-endian:b}" \
   CA53_ERR_835769_SPEC \
   CA53_ERR_843419_SPEC

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

* Re: [PATCH][AArch64] elf toolchain does not pass -shared linker option
  2015-07-22 17:33 [PATCH][AArch64] elf toolchain does not pass -shared linker option Szabolcs Nagy
@ 2015-07-24 13:46 ` Marcus Shawcroft
  2015-07-24 16:30   ` Szabolcs Nagy
  0 siblings, 1 reply; 4+ messages in thread
From: Marcus Shawcroft @ 2015-07-24 13:46 UTC (permalink / raw)
  To: Szabolcs Nagy; +Cc: gcc-patches

On 22 July 2015 at 18:22, Szabolcs Nagy <szabolcs.nagy@arm.com> wrote:

> 2015-07-22  Szabolcs Nagy  <szabolcs.nagy@arm.com>
>
>         * config/aarch64/aarch64-elf-raw.h (LINK_SPEC): Handle -h, -static,
>         -shared, -symbolic, -rdynamic.

OK, this should be back ported to 5 and 4.9 aswell.

Thanks
/Marcus

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

* Re: [PATCH][AArch64] elf toolchain does not pass -shared linker option
  2015-07-24 13:46 ` Marcus Shawcroft
@ 2015-07-24 16:30   ` Szabolcs Nagy
  2015-08-05 11:49     ` Christophe Lyon
  0 siblings, 1 reply; 4+ messages in thread
From: Szabolcs Nagy @ 2015-07-24 16:30 UTC (permalink / raw)
  To: Marcus Shawcroft; +Cc: gcc-patches

On 24/07/15 14:20, Marcus Shawcroft wrote:
> On 22 July 2015 at 18:22, Szabolcs Nagy <szabolcs.nagy@arm.com> wrote:
> 
>> 2015-07-22  Szabolcs Nagy  <szabolcs.nagy@arm.com>
>>
>>         * config/aarch64/aarch64-elf-raw.h (LINK_SPEC): Handle -h, -static,
>>         -shared, -symbolic, -rdynamic.
> 
> OK, this should be back ported to 5 and 4.9 aswell.

Committed to trunk in r226159.
Backported to 5 in r226166.
Backported to 4.9 in r226171.

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

* Re: [PATCH][AArch64] elf toolchain does not pass -shared linker option
  2015-07-24 16:30   ` Szabolcs Nagy
@ 2015-08-05 11:49     ` Christophe Lyon
  0 siblings, 0 replies; 4+ messages in thread
From: Christophe Lyon @ 2015-08-05 11:49 UTC (permalink / raw)
  To: Szabolcs Nagy; +Cc: Marcus Shawcroft, gcc-patches

On 24 July 2015 at 18:18, Szabolcs Nagy <szabolcs.nagy@arm.com> wrote:
> On 24/07/15 14:20, Marcus Shawcroft wrote:
>> On 22 July 2015 at 18:22, Szabolcs Nagy <szabolcs.nagy@arm.com> wrote:
>>
>>> 2015-07-22  Szabolcs Nagy  <szabolcs.nagy@arm.com>
>>>
>>>         * config/aarch64/aarch64-elf-raw.h (LINK_SPEC): Handle -h, -static,
>>>         -shared, -symbolic, -rdynamic.
>>
>> OK, this should be back ported to 5 and 4.9 aswell.
>
> Committed to trunk in r226159.
> Backported to 5 in r226166.
> Backported to 4.9 in r226171.
>
Hi,

Since these commits, I am seeing g++.dg/ipa/devirt-28a.C failing on
aarch64-none-elf target.
This is because the testcase uses -Wl,--no-undefined, and the linker
complains about undefined references to libc symbols.

As a workaround, I added '-lc' to the *libgloss entry in rdimon.specs.

Should this change be applied to newlib/libgloss, or did I
mis-configure something?

Thanks

Christophe.

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

end of thread, other threads:[~2015-08-05 11:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-22 17:33 [PATCH][AArch64] elf toolchain does not pass -shared linker option Szabolcs Nagy
2015-07-24 13:46 ` Marcus Shawcroft
2015-07-24 16:30   ` Szabolcs Nagy
2015-08-05 11:49     ` Christophe Lyon

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).