From: Richard Sandiford <richard.sandiford@arm.com>
To: Christophe Lyon <christophe.lyon@st.com>
Cc: Christophe Lyon <christophe.lyon@linaro.org>,
Szabolcs Nagy <Szabolcs.Nagy@arm.com>,
Rich Felker <dalias@libc.org>, nd <nd@arm.com>,
"gcc-patches\@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [ARM/FDPIC v5 03/21] [ARM] FDPIC: Force FDPIC related options unless -mno-fdpic is provided
Date: Tue, 16 Jul 2019 10:38:00 -0000 [thread overview]
Message-ID: <mpta7de9skh.fsf@arm.com> (raw)
In-Reply-To: <611566ee-a939-aef6-4354-16fbf8ad822a@st.com> (Christophe Lyon's message of "Thu, 23 May 2019 14:45:22 +0200")
Christophe Lyon <christophe.lyon@st.com> writes:
> On 22/05/2019 10:45, Christophe Lyon wrote:
>> On Wed, 22 May 2019 at 10:39, Szabolcs Nagy <Szabolcs.Nagy@arm.com> wrote:
>>>
>>> On 21/05/2019 16:28, Christophe Lyon wrote:
>>>> --- a/gcc/config/arm/linux-eabi.h
>>>> +++ b/gcc/config/arm/linux-eabi.h
>>>> @@ -89,7 +89,7 @@
>>>> #define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:eb}"
>>>> #endif
>>>> #define MUSL_DYNAMIC_LINKER \
>>>> - "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1"
>>>> + "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E
>>>> "%{mfloat-abi=hard:hf}%{mfdpic:-fdpic}.so.1"
>>>
>>> the line break seems wrong (either needs \ or no newline)
>>>
>> Sorry, that's a mailer artifact.
>>
>>>> --- a/libsanitizer/configure.tgt
>>>> +++ b/libsanitizer/configure.tgt
>>>> @@ -45,7 +45,7 @@ case "${target}" in
>>>> ;;
>>>> sparc*-*-solaris2.11*)
>>>> ;;
>>>> - arm*-*-uclinuxfdpiceabi)
>>>> + arm*-*-fdpiceabi)
>>>
>>> should be *fdpiceabi instead of *-fdpiceabi i think.
>>
>> Indeed, thanks
>> .
>>
> FWIW, here is the updated patch:
> - handles musl -fdpic suffix
> - disables sanitizers for arm*-*-fdpiceabi
> - does not handle -static in a special way, so using -static produces binaries that request the non-existing /usr/lib/ld.so.1, thus effectively making -static broken/unsupported (this does lead to a few more FAIL in the testsuite)
>
> The plan is to work -static-pie later, as discussed.
Could you make -static without -mno-fdpic an error via a %e spec,
so that the failure mode is a bit more user-friendly?
I realise this isn't your preferred option, sorry.
> diff --git a/gcc/config/arm/bpabi.h b/gcc/config/arm/bpabi.h
> index e1bacf4..6c25a1a 100644
> --- a/gcc/config/arm/bpabi.h
> +++ b/gcc/config/arm/bpabi.h
> @@ -55,6 +55,8 @@
> #define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*"\
> "|march=armv4|mcpu=fa526|mcpu=fa626:--fix-v4bx}"
>
> +#define TARGET_FDPIC_ASM_SPEC ""
Formatting nit: should be a single space before ""
> +
> #define BE8_LINK_SPEC \
> "%{!r:%{!mbe32:%:be8_linkopt(%{mlittle-endian:little}" \
> " %{mbig-endian:big}" \
> @@ -64,7 +66,7 @@
> /* Tell the assembler to build BPABI binaries. */
> #undef SUBTARGET_EXTRA_ASM_SPEC
> #define SUBTARGET_EXTRA_ASM_SPEC \
> - "%{mabi=apcs-gnu|mabi=atpcs:-meabi=gnu;:-meabi=5}" TARGET_FIX_V4BX_SPEC
> + "%{mabi=apcs-gnu|mabi=atpcs:-meabi=gnu;:-meabi=5}" TARGET_FIX_V4BX_SPEC TARGET_FDPIC_ASM_SPEC
Long line.
> diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h
> index 66ec0ea..d7cc923 100644
> --- a/gcc/config/arm/linux-eabi.h
> +++ b/gcc/config/arm/linux-eabi.h
> @@ -89,7 +89,7 @@
> #define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:eb}"
> #endif
> #define MUSL_DYNAMIC_LINKER \
> - "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1"
> + "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}%{mfdpic:-fdpic}.so.1"
>
> /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
> use the GNU/Linux version, not the generic BPABI version. */
Rich, could you confirm that this is (going to be?) the correct name?
> diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h
> index 66ec0ea..d7cc923 100644
> --- a/gcc/config/arm/linux-eabi.h
> +++ b/gcc/config/arm/linux-eabi.h
> @@ -89,7 +89,7 @@
> #define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:eb}"
> #endif
> #define MUSL_DYNAMIC_LINKER \
> - "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1"
> + "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}%{mfdpic:-fdpic}.so.1"
>
> /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
> use the GNU/Linux version, not the generic BPABI version. */
> @@ -101,11 +101,14 @@
> #undef ASAN_CC1_SPEC
> #define ASAN_CC1_SPEC "%{%:sanitize(address):-funwind-tables}"
>
> +#define FDPIC_CC1_SPEC ""
> +
> #undef CC1_SPEC
> #define CC1_SPEC \
> - LINUX_OR_ANDROID_CC (GNU_USER_TARGET_CC1_SPEC " " ASAN_CC1_SPEC, \
> + LINUX_OR_ANDROID_CC (GNU_USER_TARGET_CC1_SPEC " " ASAN_CC1_SPEC " " \
> + FDPIC_CC1_SPEC, \
> GNU_USER_TARGET_CC1_SPEC " " ASAN_CC1_SPEC " " \
> - ANDROID_CC1_SPEC)
> + ANDROID_CC1_SPEC "" FDPIC_CC1_SPEC)
>
> #define CC1PLUS_SPEC \
> LINUX_OR_ANDROID_CC ("", ANDROID_CC1PLUS_SPEC)
Does it make sense to add FDPIC_CC1_SPEC to the Android version?
> diff --git a/gcc/config/arm/uclinuxfdpiceabi.h b/gcc/config/arm/uclinuxfdpiceabi.h
> new file mode 100644
> index 0000000..3180bcd
> --- /dev/null
> +++ b/gcc/config/arm/uclinuxfdpiceabi.h
> @@ -0,0 +1,52 @@
> +/* Configuration file for ARM GNU/Linux FDPIC EABI targets.
> + Copyright (C) 2018 Free Software Foundation, Inc.
> + Contributed by STMicroelectronics.
> +
> + This file is part of GCC.
> +
> + GCC is free software; you can redistribute it and/or modify it
> + under the terms of the GNU General Public License as published
> + by the Free Software Foundation; either version 3, or (at your
> + option) any later version.
> +
> + GCC is distributed in the hope that it will be useful, but WITHOUT
> + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
> + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
> + License for more details.
> +
> + You should have received a copy of the GNU General Public License
> + along with GCC; see the file COPYING3. If not see
> + <http://www.gnu.org/licenses/>. */
> +
> +/* On uClibc EABI GNU/Linux, we want to force -mfdpic by default,
> + which also means we produce PIE code by default. */
> +#undef FDPIC_CC1_SPEC
> +#define FDPIC_CC1_SPEC \
> + "%{!mno-fdpic:-mfdpic %{!no-PIE:%{!fpie:%{!fPIC:%{!fpic: -fPIE}}}}}"
Looks like the !no-PIE should be !fno-PIE.
> +/* Add --fdpic assembler flag by default. */
> +#undef TARGET_FDPIC_ASM_SPEC
> +#define TARGET_FDPIC_ASM_SPEC "%{!mno-fdpic: --fdpic}"
Single space before the ".
Thanks,
Richard
next prev parent reply other threads:[~2019-07-16 10:34 UTC|newest]
Thread overview: 109+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-15 12:40 [ARM/FDPIC v5 00/21] FDPIC ABI for ARM Christophe Lyon
2019-05-15 12:40 ` [ARM/FDPIC v5 01/21] [ARM] FDPIC: Add -mfdpic option support Christophe Lyon
2019-07-16 10:18 ` Richard Sandiford
2019-08-29 15:08 ` Christophe Lyon
2019-08-30 10:06 ` Richard Sandiford
2019-05-15 12:41 ` [ARM/FDPIC v5 02/21] [ARM] FDPIC: Handle arm*-*-uclinuxfdpiceabi in configure scripts Christophe Lyon
2019-07-12 7:44 ` Richard Sandiford
2019-07-12 13:25 ` Christophe Lyon
2019-07-12 13:28 ` Richard Sandiford
2019-08-29 15:14 ` Christophe Lyon
2019-08-30 9:30 ` Richard Sandiford
2019-08-30 14:48 ` Christophe Lyon
2019-08-30 15:15 ` Richard Sandiford
2019-09-02 7:51 ` Christophe Lyon
2019-09-02 8:31 ` Richard Sandiford
2019-08-30 14:40 ` Jonathan Wakely
2019-05-15 12:41 ` [ARM/FDPIC v5 05/21] [ARM] FDPIC: Fix __do_global_dtors_aux and frame_dummy generation Christophe Lyon
2019-07-12 6:49 ` Richard Sandiford
2019-07-12 14:25 ` Christophe Lyon
2019-08-29 15:39 ` Christophe Lyon
2019-08-30 8:41 ` Richard Sandiford
2019-05-15 12:41 ` [ARM/FDPIC v5 04/21] [ARM] FDPIC: Add support for FDPIC for arm architecture Christophe Lyon
2019-07-16 12:33 ` Richard Sandiford
2019-08-20 17:13 ` Christophe Lyon
2019-08-29 15:39 ` Christophe Lyon
2019-09-02 16:12 ` Richard Sandiford
2019-09-02 20:04 ` Christophe Lyon
2019-09-03 8:40 ` Richard Sandiford
2019-09-04 19:59 ` Christophe Lyon
2019-09-05 8:03 ` Richard Sandiford
2019-05-15 12:41 ` [ARM/FDPIC v5 03/21] [ARM] FDPIC: Force FDPIC related options unless -mno-fdpic is provided Christophe Lyon
2019-05-15 13:55 ` Szabolcs Nagy
2019-05-15 14:37 ` Rich Felker
2019-05-15 15:12 ` Christophe Lyon
2019-05-15 15:37 ` Rich Felker
2019-05-15 15:59 ` Szabolcs Nagy
2019-05-15 16:07 ` Rich Felker
2019-05-21 15:29 ` Christophe Lyon
2019-05-21 15:48 ` Rich Felker
2019-05-22 8:39 ` Szabolcs Nagy
2019-05-22 8:45 ` Christophe Lyon
2019-05-23 12:45 ` Christophe Lyon
2019-07-16 10:38 ` Richard Sandiford [this message]
2019-07-16 20:00 ` Rich Felker
2019-08-01 10:13 ` Christophe Lyon
2019-08-06 14:28 ` Richard Sandiford
2019-08-29 15:14 ` Christophe Lyon
2019-08-30 9:40 ` Richard Sandiford
2019-05-15 12:42 ` [ARM/FDPIC v5 06/21] [ARM] FDPIC: Add support for c++ exceptions Christophe Lyon
2019-08-30 9:31 ` Kyrill Tkachov
2019-08-30 14:44 ` Jonathan Wakely
2019-05-15 12:42 ` [ARM/FDPIC v5 07/21] [ARM] FDPIC: Avoid saving/restoring r9 on stack since it is read-only Christophe Lyon
2019-07-16 10:42 ` Kyrill Tkachov
2019-05-15 12:43 ` [ARM/FDPIC v5 10/21] [ARM] FDPIC: Implement TLS support Christophe Lyon
2019-09-04 14:16 ` Kyrill Tkachov
2019-09-04 20:03 ` Christophe Lyon
2019-09-09 8:54 ` Christophe Lyon
2019-05-15 12:43 ` [ARM/FDPIC v5 09/21] [ARM] FDPIC: Add support for taking address of nested function Christophe Lyon
2019-07-16 11:53 ` Kyrill Tkachov
2019-07-16 13:31 ` Kyrill Tkachov
2019-07-31 14:48 ` Christophe Lyon
2019-08-29 15:40 ` Christophe Lyon
2019-08-30 8:54 ` Kyrill Tkachov
2019-05-15 12:43 ` [ARM/FDPIC v5 08/21] [ARM] FDPIC: Enforce local/global binding for function descriptors Christophe Lyon
2019-07-16 10:51 ` Kyrill Tkachov
2019-05-15 12:44 ` [ARM/FDPIC v5 12/21] [ARM] FDPIC: Restore r9 after we call __aeabi_read_tp Christophe Lyon
2019-08-29 15:40 ` Christophe Lyon
2019-08-29 15:44 ` Kyrill Tkachov
2019-05-15 12:44 ` [ARM/FDPIC v5 11/21] [ARM] FDPIC: Add support to unwind FDPIC signal frame Christophe Lyon
2019-09-04 14:19 ` Kyrill Tkachov
2019-05-15 12:44 ` [ARM/FDPIC v5 13/21] [ARM] FDPIC: Force LSB bit for PC in Cortex-M architecture Christophe Lyon
2019-08-29 15:37 ` Kyrill Tkachov
2019-09-05 8:30 ` Christophe Lyon
2019-09-05 8:32 ` Christophe Lyon
2019-09-05 20:56 ` Ian Lance Taylor
2019-09-05 9:03 ` Kyrill Tkachov
2019-09-09 8:58 ` Christophe Lyon
2019-05-15 12:45 ` [ARM/FDPIC v5 15/21] [ARM][testsuite] FDPIC: Adjust scan-assembler patterns Christophe Lyon
2019-07-19 8:54 ` Kyrill Tkachov
2019-05-15 12:45 ` [ARM/FDPIC v5 14/21] [ARM][testsuite] FDPIC: Skip unsupported tests Christophe Lyon
2019-07-19 8:52 ` Kyrill Tkachov
2019-05-15 12:45 ` [ARM/FDPIC v5 16/21] [ARM][testsuite] FDPIC: Skip tests that don't work in PIC mode Christophe Lyon
2019-07-19 8:56 ` Kyrill Tkachov
2019-05-15 12:46 ` [ARM/FDPIC v5 19/21] [ARM][testsuite] FDPIC: Adjust pr43698.c to avoid clash with uclibc Christophe Lyon
2019-07-19 9:00 ` Kyrill Tkachov
2019-05-15 12:46 ` [ARM/FDPIC v5 17/21] [ARM][testsuite] FDPIC: Handle *-*-uclinux* Christophe Lyon
2019-07-19 8:57 ` Kyrill Tkachov
2019-07-22 19:37 ` Mike Stump
2019-05-15 12:46 ` [ARM/FDPIC v5 18/21] [ARM][testsuite] FDPIC: Enable tests on pie_enabled targets Christophe Lyon
2019-07-19 8:59 ` Kyrill Tkachov
2019-07-22 19:50 ` Mike Stump
2019-05-15 12:47 ` [ARM/FDPIC v5 21/21] [ARM] FDPIC: Handle stack-protector combined patterns Christophe Lyon
2019-07-19 9:40 ` Kyrill Tkachov
2019-05-15 12:47 ` [ARM/FDPIC v5 20/21] [ARM][testsuite] FDPIC: Skip tests using architectures unsupported by FDPIC Christophe Lyon
2019-07-19 9:03 ` Kyrill Tkachov
2019-09-06 8:01 ` Christophe Lyon
2019-09-06 8:28 ` Kyrill Tkachov
2019-09-06 9:10 ` Christophe Lyon
2019-09-06 17:44 ` Christophe Lyon
2019-09-09 8:38 ` Christophe Lyon
2019-05-23 12:46 ` [ARM/FDPIC v5 00/21] FDPIC ABI for ARM Christophe Lyon
2019-06-04 12:57 ` Christophe Lyon
2019-06-06 12:36 ` Christophe Lyon
2019-06-17 11:42 ` Christophe Lyon
2019-07-01 12:16 ` Christophe Lyon
2019-07-08 14:28 ` Christophe Lyon
2019-07-16 9:13 ` Christophe Lyon
2019-08-29 14:54 ` Christophe Lyon
2019-08-29 16:29 ` Christophe Lyon
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=mpta7de9skh.fsf@arm.com \
--to=richard.sandiford@arm.com \
--cc=Szabolcs.Nagy@arm.com \
--cc=christophe.lyon@linaro.org \
--cc=christophe.lyon@st.com \
--cc=dalias@libc.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=nd@arm.com \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).