From patchwork Mon Sep 9 15:44:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 1159802 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-508643-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Z6Thu0z1"; dkim=pass (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="0xnQ0F8d"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46Rsvp4Yhlz9s00 for ; Tue, 10 Sep 2019 01:46:14 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=Tvq 2PfeIGWp5ZzjC9l0VTGjT2FUgiNx48aNVGNUYk5KHytj/3b2uR/k92x27VhNp+cF IBNeE1vBxO/ImJw8T0nBJghyG2e4BPn4nSyV+XpV7rbS/FlkiNThdr0GzjzC/DCR D5ThFltY2RLRGYizre35daX98oFx3h+krCmnmyCo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=ykygVRnY0 IhUy37+HNqiOJYSinc=; b=Z6Thu0z1gv8FAoRnXxJyAwzo4ERn5B5aJajZuLncu lYCqWTJI9dApS0PsoPpK7QcY+hxkKQjr/EN0o9M23dvW7NZ+H670wPboc6KVx6YO bqZKntuhh1hcJ5aGieYHrcDBZSrJAZapT5LtcDcjV6dqXo1S2i36ln0RAJW6a67U ik= Received: (qmail 109822 invoked by alias); 9 Sep 2019 15:46:02 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 109766 invoked by uid 89); 9 Sep 2019 15:46:01 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=Tools, involve X-HELO: mx07-00178001.pphosted.com Received: from mx08-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (91.207.212.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:46:00 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89Ff36I031790 for ; Mon, 9 Sep 2019 17:45:57 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=B71ts0sAgrBcNg6EtyntAtalVP20hMPr6iWKfcgfQzI=; b=0xnQ0F8dzJp889Er7bEt6cegKqEd/cipE6ZyKs/EoJKdvgGSpz/hT4LGKJlv+TysT35o tj9NTbEiw3XNSceI8KXs91UIZpEIbVRE1/gJ3/vPD5Ur8Zv66oVgHDhrfss6Mk4Treoj KB6cj/Gc1SuTdYjYwsXdB6zcvoJfxMiWJu536Lmo/qMKQ+cOucEGdxO4xlfJiWCbWJIL 8IHfi4WOiarZRwRYMed0MwBFCe+dncnpzX9qVJPa8yCiVKdF3SQg63NqwFXnVlfGAeqq dp8ibnWwOp3l2PnzQTeJwDn8NxuFS7wXZHpQBCKsszAsoneMNWKdUilnHqRQuk9EauGj IA== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx08-00178001.pphosted.com with ESMTP id 2uv3ehpj63-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:45:57 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 0CF5722 for ; Mon, 9 Sep 2019 15:45:54 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 453C92B9BC5 for ; Mon, 9 Sep 2019 17:45:53 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:45:53 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 01/24] [ARM] FDPIC: Add -mfdpic option support Date: Mon, 9 Sep 2019 17:44:43 +0200 Message-ID: <20190909154526.11630-2-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon 2019-XX-XX Christophe Lyon Mickaël Guêné gcc/ * config/arm/arm.opt: Add -mfdpic option. * doc/invoke.texi: Add documentation for -mfdpic. Change-Id: I05b98d6ae87c2b3fc04dd7fba415c730accdf33e diff --git a/gcc/config/arm/arm.opt b/gcc/config/arm/arm.opt index 5ecc5e5..545ec49 100644 --- a/gcc/config/arm/arm.opt +++ b/gcc/config/arm/arm.opt @@ -306,3 +306,7 @@ Cost to assume for a branch insn. mgeneral-regs-only Target Report RejectNegative Mask(GENERAL_REGS_ONLY) Save Generate code which uses the core registers only (r0-r14). + +mfdpic +Target Report Mask(FDPIC) +Enable Function Descriptor PIC mode. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index bfcd76e..cc283ff 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -711,7 +711,8 @@ Objective-C and Objective-C++ Dialects}. -mrestrict-it @gol -mverbose-cost-dump @gol -mpure-code @gol --mcmse} +-mcmse @gol +-mfdpic} @emph{AVR Options} @gccoptlist{-mmcu=@var{mcu} -mabsdata -maccumulate-args @gol @@ -18043,6 +18044,27 @@ MOVT instruction. Generate secure code as per the "ARMv8-M Security Extensions: Requirements on Development Tools Engineering Specification", which can be found on @url{http://infocenter.arm.com/help/topic/com.arm.doc.ecm0359818/ECM0359818_armv8m_security_extensions_reqs_on_dev_tools_1_0.pdf}. + +@item -mfdpic +@itemx -mno-fdpic +@opindex mfdpic +@opindex mno-fdpic +Select the FDPIC ABI, which uses 64-bit function descriptors to +represent pointers to functions. When the compiler is configured for +@code{arm-*-uclinuxfdpiceabi} targets, this option is on by default +and implies @option{-fPIE} if none of the PIC/PIE-related options is +provided. On other targets, it only enables the FDPIC-specific code +generation features, and the user should explicitly provide the +PIC/PIE-related options as needed. + +Note that static linking is not supported because it would still +involve the dynamic linker when the program self-relocates. If such +behavior is acceptable, use -static and -Wl,-dynamic-linker options. + +The opposite @option{-mno-fdpic} option is useful (and required) to +build the Linux kernel using the same (@code{arm-*-uclinuxfdpiceabi}) +toolchain as the one used to build the userland programs. + @end table @node AVR Options From patchwork Mon Sep 9 15:44:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 1159803 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-508644-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="QVWjxkNt"; dkim=pass (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="sv6tnkWw"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46Rsw80LRqz9s7T for ; Tue, 10 Sep 2019 01:46:31 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; q=dns; s=default; b=yYX1HBoLLKP++8yM3BXxgKRMca8CW jJ6IH1bVwoLUsTXnP1P6OUH/CJ3T8GwkGq3eGL32oSB1pd0cafRe155UdWrXC0Hj MRV7VdUExV5qb5FWIGbWCoZKI4o1Bdp5TDsf0sNL2lYTcySx1cz8FRfxrNcEWydH 3FEQ7oeu6hP1w4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; s=default; bh=rBsXjtNZbyGHmHR4BWCrBAC5SxY=; b=QVW jxkNtxGvEVSmHGgK1W5xeglEV0+XAFXF1HHtsIUNaoV5j2nrwwWA5FAgLJwHnJhK AxNFgNazecXg16kQECewF8gt737GJJD8ParqK69rlVAn9mKGc8Phll7kohrK1dPh sJE/povRnzkNIOMxsiJV3houidAveJXgj1RDRtNs= Received: (qmail 111885 invoked by alias); 9 Sep 2019 15:46:22 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 111867 invoked by uid 89); 9 Sep 2019 15:46:21 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=Shared, $CC, $cc, CC X-HELO: mx07-00178001.pphosted.com Received: from mx08-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (91.207.212.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:46:19 +0000 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FkBAT003543 for ; Mon, 9 Sep 2019 17:46:17 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=ivICdiNmJlxK2UVAdpAJrRLxK/sHbXz6eoym5bsjkmA=; b=sv6tnkWwbHWaEQ4acv7Br8hMra8h/55ApjBaO12OjH6Ro2TmyeN816us5kAIQl+6vDlM B81xsfs1DNWMOOqPhOJXljNzY8crbKBODVcyHm/DDW5V6IdtS6LQMB11kK6JBCePV3Qn uJi8kwc8oZ0Gu2YAbl+4pO4XFx0D4qUG/fnoqeU9Np5uLBJ4T5ZXGsqa9UmGeLAGvrZ9 g/XTIgY/oyezVLTMq/cXkRKEn/rztgPGAPb3cxnKLeC8iXTnOYYhuPl1bMOy9jcnk6XT 8nrHVvF//BOImiI5e4ytk8MHznOHnMKlZIaVUCU0Htt+y3qp0CQhajZFRYpExy6ya4Vt 2A== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx08-00178001.pphosted.com with ESMTP id 2uv1pa707u-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:46:17 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 1C7F04D for ; Mon, 9 Sep 2019 15:46:14 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 7E5FB2B9BC6 for ; Mon, 9 Sep 2019 17:46:13 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:46:13 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 02/24] [ARM] FDPIC: Handle arm*-*-uclinuxfdpiceabi in configure scripts Date: Mon, 9 Sep 2019 17:44:44 +0200 Message-ID: <20190909154526.11630-3-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon The new arm-uclinuxfdpiceabi target behaves pretty much like arm-linux-gnueabi. In order to enable the same set of features, we have to update several configure scripts that generally match targets like *-*-linux*: in most places, we add *-uclinux* where there is already *-linux*, or uclinux* when there is already linux*. In gcc/config.gcc and libgcc/config.host we use *-*-uclinuxfdpiceabi because there is already a different behaviour for *-*uclinux* target. In libtool.m4, we use uclinuxfdpiceabi in cases where ELF shared libraries support is required, as uclinux does not guarantee that. 2019-XX-XX Christophe Lyon config/ * futex.m4: Handle *-uclinux*. * tls.m4 (GCC_CHECK_TLS): Likewise. gcc/ * config.gcc: Handle *-*-uclinuxfdpiceabi. libatomic/ * configure.tgt: Handle arm*-*-uclinux*. * configure: Regenerate. libgcc/ * config.host: Handle *-*-uclinuxfdpiceabi. libitm/ * configure.tgt: Handle *-*-uclinux*. * configure: Regenerate. * libtool.m4: Handle uclinuxfdpiceabi. Change-Id: Ib3a08905879ef917ee6c04c3988cf4ced7209fef diff --git a/config/futex.m4 b/config/futex.m4 index 1b43829..c212438 100644 --- a/config/futex.m4 +++ b/config/futex.m4 @@ -9,7 +9,7 @@ AC_DEFUN([GCC_LINUX_FUTEX],[dnl GCC_ENABLE(linux-futex,default, ,[use the Linux futex system call], permit yes|no|default) case "$target" in - *-linux*) + *-linux* | *-uclinux*) case "$enable_linux_futex" in default) # If headers don't have gettid/futex syscalls definition, then diff --git a/config/tls.m4 b/config/tls.m4 index 1a5fc59..7532305 100644 --- a/config/tls.m4 +++ b/config/tls.m4 @@ -76,7 +76,7 @@ AC_DEFUN([GCC_CHECK_TLS], [ dnl Shared library options may depend on the host; this check dnl is only known to be needed for GNU/Linux. case $host in - *-*-linux*) + *-*-linux* | -*-uclinuxfdpic*) LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS" ;; esac diff --git a/gcc/config.gcc b/gcc/config.gcc index 94a3608..69904fd 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -771,7 +771,7 @@ case ${target} in *-*-fuchsia*) native_system_header_dir=/include ;; -*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) +*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu | *-*-uclinuxfdpiceabi) extra_options="$extra_options gnu-user.opt" gas=yes gnu_ld=yes @@ -800,7 +800,7 @@ case ${target} in *-*-*android*) tm_defines="$tm_defines DEFAULT_LIBC=LIBC_BIONIC" ;; - *-*-*uclibc*) + *-*-*uclibc* | *-*-uclinuxfdpiceabi) tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC" ;; *-*-*musl*) @@ -1198,7 +1198,7 @@ arm*-*-netbsdelf*) armv7*) target_cpu_cname="generic-armv7-a";; esac ;; -arm*-*-linux-*) # ARM GNU/Linux with ELF +arm*-*-linux-* | arm*-*-uclinuxfdpiceabi) tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h" extra_options="${extra_options} linux-android.opt" case $target in diff --git a/libatomic/configure b/libatomic/configure index e6f5fb7..7bd01a1 100755 --- a/libatomic/configure +++ b/libatomic/configure @@ -6055,7 +6055,7 @@ irix5* | irix6* | nonstopux*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) lt_cv_deplibs_check_method=pass_all ;; @@ -9135,7 +9135,7 @@ _LT_EOF archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in @@ -10666,7 +10666,12 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) + +# uclinux* changes (here and below) have been submitted to the libtool +# project, but have not yet been accepted: they are GCC-local changes +# for the time being. (See +# https://lists.gnu.org/archive/html/libtool-patches/2018-05/msg00000.html) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) version_type=linux need_lib_prefix=no need_version=no diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt index 4a1294b..61778fb 100644 --- a/libatomic/configure.tgt +++ b/libatomic/configure.tgt @@ -124,7 +124,7 @@ case "${target}" in config_path="${config_path} linux/aarch64 posix" ;; - arm*-*-linux*) + arm*-*-linux* | arm*-*-uclinux*) # OS support for atomic primitives. config_path="${config_path} linux/arm posix" ;; diff --git a/libgcc/config.host b/libgcc/config.host index 1db5287..bfe5952 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -245,7 +245,7 @@ case ${host} in tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-fuchsia" extra_parts="crtbegin.o crtend.o" ;; -*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) +*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu | *-*-uclinuxfdpiceabi) tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux" extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o" if test x$enable_vtable_verify = xyes; then @@ -450,7 +450,7 @@ arm*-*-netbsdelf*) ;; esac ;; -arm*-*-linux*) # ARM GNU/Linux with ELF +arm*-*-linux* | arm*-*-uclinuxfdpiceabi) tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix t-crtfm" tmake_file="${tmake_file} arm/t-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc" tm_file="$tm_file arm/bpabi-lib.h" diff --git a/libitm/configure b/libitm/configure old mode 100644 new mode 100755 index c466ae0..5315fab --- a/libitm/configure +++ b/libitm/configure @@ -6731,7 +6731,7 @@ irix5* | irix6* | nonstopux*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) lt_cv_deplibs_check_method=pass_all ;; @@ -9812,7 +9812,7 @@ _LT_EOF archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in @@ -11343,7 +11343,12 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) + +# uclinux* changes (here and below) have been submitted to the libtool +# project, but have not yet been accepted: they are GCC-local changes +# for the time being. (See +# https://lists.gnu.org/archive/html/libtool-patches/2018-05/msg00000.html) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) version_type=linux need_lib_prefix=no need_version=no @@ -15003,7 +15008,12 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) + +# uclinux* changes (here and below) have been submitted to the libtool +# project, but have not yet been accepted: they are GCC-local changes +# for the time being. (See +# https://lists.gnu.org/archive/html/libtool-patches/2018-05/msg00000.html) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) version_type=linux need_lib_prefix=no need_version=no @@ -16468,7 +16478,7 @@ fi case "$target" in - *-linux*) + *-linux* | *-uclinux*) case "$enable_linux_futex" in default) # If headers don't have gettid/futex syscalls definition, then @@ -16593,7 +16603,7 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : chktls_save_LDFLAGS="$LDFLAGS" case $host in - *-*-linux*) + *-*-linux* | -*-uclinuxfdpic*) LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS" ;; esac diff --git a/libitm/configure.tgt b/libitm/configure.tgt index 4c0b602..eea865d 100644 --- a/libitm/configure.tgt +++ b/libitm/configure.tgt @@ -127,7 +127,7 @@ config_path="$ARCH posix generic" # Other system configury case "${target}" in - *-*-linux*) + *-*-linux* | *-*-uclinux*) if test "$enable_linux_futex" = yes; then config_path="linux/$ARCH linux $config_path" fi diff --git a/libtool.m4 b/libtool.m4 index 8966762..e194e89 100644 --- a/libtool.m4 +++ b/libtool.m4 @@ -2449,7 +2449,12 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) + +# uclinux* changes (here and below) have been submitted to the libtool +# project, but have not yet been accepted: they are GCC-local changes +# for the time being. (See +# https://lists.gnu.org/archive/html/libtool-patches/2018-05/msg00000.html) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) version_type=linux need_lib_prefix=no need_version=no @@ -3089,7 +3094,7 @@ irix5* | irix6* | nonstopux*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) lt_cv_deplibs_check_method=pass_all ;; @@ -4449,7 +4454,7 @@ _LT_EOF _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in From patchwork Mon Sep 9 15:44:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 1159804 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-508645-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="kEKxOyl9"; dkim=pass (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="OzziAZpb"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46RswY6czyz9s7T for ; Tue, 10 Sep 2019 01:46:53 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=ELl JB7p7qQyLjs3NZC5a1o5d2BMBhUpqZmWu/fu+YJiMeWE0xoSlRbwMC5Xopv0b8Rb 346H6BZFhV6g4RJzVSF8U4gqSwTeWMosjhs5fY0UGnNaSivrbiWRa+IQ0c1VHDjA CQbVxrtDM4InGDwHlz45xNUirexYWndSEccR5PnQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=t4pckgjU/ t/cZyTniuEIk1NW3MI=; b=kEKxOyl9iwl2iFgCShEyYMpPPDvnrN6dhdtDAtIoz RmNF5/9Kk9wAvjwdnmyL74kJMZDTUwNp4BuDb058LyLpy5sT3TntXaIcHYOXrogQ M6Ye0YjW5NjTNr/Tz7Cpd83s2L2Cxj9m3d1YDa4I6H0p/jnCyJvptOUF3DVDMU+B co= Received: (qmail 113411 invoked by alias); 9 Sep 2019 15:46:46 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 113403 invoked by uid 89); 9 Sep 2019 15:46:46 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx07-00178001.pphosted.com Received: from mx08-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (91.207.212.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:46:45 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FkgaM027615 for ; Mon, 9 Sep 2019 17:46:42 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=msFjZApsUqI6yomSYB7PGt0ODu+kVLdK3ralH3/PEoU=; b=OzziAZpbVopeGo9aeouoUEjsRqAw7529YSo1OYtNH7YPRC/9Mipi8yAZlz8TzpVTOVLL 2fyTn30T+lh8QI5DRM4mvOtmCiN0ayq4HYxNIkozKpTmh+jvFRDmNXpuRWA1/38l3nCI vOg7SJmvbacLTvS2kXzmr7YOTpefxPQjwDrj/fbfnJvdUANTbGsbNfWle5xmvSmUpq3e zSloR+sN0RWLyUVNNkfCREgKVaiyoalHXvBWI0XXscJfD7SY2OusPBAUCYvDxpPY5oiY C5pKxDNRy2wa6AZfIPsD5dMkdoTmmuwXUMuJOQlHV4qZ3x8settNh4gD1oyYswQmAbN1 KQ== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx08-00178001.pphosted.com with ESMTP id 2uv3ehpjb5-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:46:42 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 41AAB4C for ; Mon, 9 Sep 2019 15:46:34 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id A2DB32B9BCE for ; Mon, 9 Sep 2019 17:46:33 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:46:33 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 03/24] [ARM] FDPIC: Force FDPIC related options unless -mno-fdpic is provided Date: Mon, 9 Sep 2019 17:44:45 +0200 Message-ID: <20190909154526.11630-4-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon In FDPIC mode, we set -fPIE unless the user provides -fno-PIE, -fpie, -fPIC or -fpic: indeed FDPIC code is PIC, but we want to generate code for executables rather than shared libraries by default. We also make sure to use the --fdpic assembler option, and select the appropriate linker emulation. At link time, we also default to -pie, unless we are generating a shared library or a relocatable file (-r). Note that static link is not supported as it requires specifying the dynamic linker because the executable still has to relocate itself at startup. We also force 'now' binding since lazy binding is not supported. We should also apply the same behavior for -Wl,-Ur as for -r, but I couldn't find how to describe that in the specs fragment. 2019-XX-XX Christophe Lyon Mickaël Guêné gcc/ * config.gcc: Handle arm*-*-uclinuxfdpiceabi. * config/arm/bpabi.h (TARGET_FDPIC_ASM_SPEC): New. (SUBTARGET_EXTRA_ASM_SPEC): Use TARGET_FDPIC_ASM_SPEC. * config/arm/linux-eabi.h (FDPIC_CC1_SPEC): New. (CC1_SPEC): Use FDPIC_CC1_SPEC. (MUSL_DYNAMIC_LINKER): Add -fdpic suffix when needed. * config/arm/uclinuxfdpiceabi.h: New file. libsanitizer/ * configure.tgt (arm*-*-*fdpiceabi): Sanitizers are unsupported in this configuration. Change-Id: I74ac1fbb2e809e864d2b0acce66b173e76bcf92b diff --git a/gcc/config.gcc b/gcc/config.gcc index 69904fd..2a6a8f0 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1208,6 +1208,11 @@ arm*-*-linux-* | arm*-*-uclinuxfdpiceabi) esac tmake_file="${tmake_file} arm/t-arm arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi" tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h arm/aout.h arm/arm.h" + case $target in + arm*-*-uclinuxfdpiceabi) + tm_file="$tm_file arm/uclinuxfdpiceabi.h" + ;; + esac # Generation of floating-point instructions requires at least ARMv5te. if [ "$with_float" = "hard" -o "$with_float" = "softfp" ] ; then target_cpu_cname="arm10e" diff --git a/gcc/config/arm/bpabi.h b/gcc/config/arm/bpabi.h index e1bacf4..75d9a99 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 "" + #define BE8_LINK_SPEC \ "%{!r:%{!mbe32:%:be8_linkopt(%{mlittle-endian:little}" \ " %{mbig-endian:big}" \ @@ -64,7 +66,8 @@ /* 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 #ifndef SUBTARGET_EXTRA_LINK_SPEC #define SUBTARGET_EXTRA_LINK_SPEC "" diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h index 66ec0ea..b348971 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,9 +101,12 @@ #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) diff --git a/gcc/config/arm/uclinuxfdpiceabi.h b/gcc/config/arm/uclinuxfdpiceabi.h new file mode 100644 index 0000000..328adcb --- /dev/null +++ b/gcc/config/arm/uclinuxfdpiceabi.h @@ -0,0 +1,54 @@ +/* Configuration file for ARM GNU/Linux FDPIC EABI targets. + Copyright (C) 2018,2019 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 + . */ + +/* 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 %{!fno-PIE:%{!fpie:%{!fPIC:%{!fpic: -fPIE}}}}}" + +/* Add --fdpic assembler flag by default. */ +#undef TARGET_FDPIC_ASM_SPEC +#define TARGET_FDPIC_ASM_SPEC "%{!mno-fdpic: --fdpic}" + +/* TARGET_BIG_ENDIAN_DEFAULT is set in + config.gcc for big endian configurations. */ +#if TARGET_BIG_ENDIAN_DEFAULT +#define TARGET_FDPIC_LINKER_EMULATION "armelfb_linux_fdpiceabi" +#else +#define TARGET_FDPIC_LINKER_EMULATION "armelf_linux_fdpiceabi" +#endif + +/* Unless we generate a shared library or a relocatable object, we + force -pie. */ +/* -static is not supported, because we have to define the + dynamic-linker, as we have some relocations to resolve at load + time. We do not generate an error in case the user explictly passes + the -dynamic-linker option to the linker. */ +#undef SUBTARGET_EXTRA_LINK_SPEC +#define SUBTARGET_EXTRA_LINK_SPEC \ + "%{!mno-fdpic: -m " TARGET_FDPIC_LINKER_EMULATION \ + "%{!shared:%{!r: -pie}} }" \ + "%{mno-fdpic: -m " TARGET_LINKER_EMULATION "}" \ + "%{!r:%{!mno-fdpic: -z now}}" + +#undef STARTFILE_SPEC +#define STARTFILE_SPEC "%{!mno-fdpic:%{!shared:crtreloc.o%s}} " \ + LINUX_OR_ANDROID_LD (GNU_USER_TARGET_STARTFILE_SPEC, ANDROID_STARTFILE_SPEC) diff --git a/libsanitizer/configure.tgt b/libsanitizer/configure.tgt index 3fb90ea..714f292 100644 --- a/libsanitizer/configure.tgt +++ b/libsanitizer/configure.tgt @@ -42,6 +42,9 @@ case "${target}" in ;; sparc*-*-solaris2.11*) ;; + arm*-*-*fdpiceabi) + UNSUPPORTED=1 + ;; arm*-*-linux*) ;; mips*64*-*-linux*) From patchwork Mon Sep 9 15:44:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 1159805 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-508646-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Sp/4oaWt"; dkim=pass (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="d9rZL8Ux"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46Rswx3FQ3z9s00 for ; Tue, 10 Sep 2019 01:47:13 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=AM1 JazLEcL0dxKPHiTaVVRS+z7x4xcc7PrSpdHmtMAW4je3Amp3IKczx9zsA99a/oXv Ue2d2IDXlJ+GY+7WGKl4DHvciiSnMsC/yauGdiLZsp/1inOEgyUKH28kNu5bS2oB FweqOFK22RLfiKlVq3tx1+lJAvaVzTW93oVY5Wwg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=NNL9riMdb 1rsHc2+IMFb+3ZFyvA=; b=Sp/4oaWtui3NNFz2q8PFaBeVbXJFKOXQeHNay4chN rIaP36vT29iDe0MUVPVtDZMF2SRShxQYsQpBS43N2aoXxdaNtsqFFmz9l4rdd8h/ MoxMD2XCobCiqu6sxa9rJor6Vha0NnCPJzeBKWWoFRsddSr11RrjNqMIPvNpjIHv AE= Received: (qmail 115094 invoked by alias); 9 Sep 2019 15:47:05 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 115086 invoked by uid 89); 9 Sep 2019 15:47:05 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_STOCKGEN, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=rm X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:47:01 +0000 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FkMTq001843 for ; Mon, 9 Sep 2019 17:46:58 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=sHqBuws+U4sZgFQnPy0bOSp+RU+GMyPrGIvelY35shg=; b=d9rZL8UxWRmlmCuyy4PDyWeu74e9ipRc0PHiGNPA2VWTkH7TQmUSkXzYChB7QViksnvH 8oUcZqGYA/4EXi8ms9SdF8VNctdDlqtyxQHw4E7sEDByASeYdeAsuSJeVRXb+Ko257S8 D5Ph0B25LdcWg/3G2Km0+VCREq7AmtNWYFWaFHMJcVgai+de6bJmX6jkUvMVoihEn0KV PqKWFUH/Aw5cuzvbPvXbVgCIj7a13FT0Q01pnLDoaBkzlN20Kx+itpR1vhXi7RDicOsQ ry2L9chiSJmRncX1ItFly9yp1gXUKIJmFSAGynt2DdTQT5xgiru66Q70fGChT8PgXADz 3A== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com with ESMTP id 2uv2avxh1j-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:46:57 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 7C1484B for ; Mon, 9 Sep 2019 15:46:54 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id DC4A52B9BCB for ; Mon, 9 Sep 2019 17:46:53 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:46:53 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 04/24] [ARM] FDPIC: Add support for FDPIC for arm architecture Date: Mon, 9 Sep 2019 17:44:46 +0200 Message-ID: <20190909154526.11630-5-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon The FDPIC register is hard-coded to r9, as defined in the ABI. We have to disable tailcall optimizations if we don't know if the target function is in the same module. If not, we have to set r9 to the value associated with the target module. When generating a symbol address, we have to take into account whether it is a pointer to data or to a function, because different relocations are needed. 2019-XX-XX Christophe Lyon Mickaël Guêné gcc/ * config/arm/arm-c.c (__FDPIC__): Define new pre-processor macro in FDPIC mode. * config/arm/arm-protos.h (arm_load_function_descriptor): Declare new function. * config/arm/arm.c (arm_option_override): Define pic register to FDPIC_REGNUM. (arm_function_ok_for_sibcall): Disable sibcall optimization if we have no decl or go through PLT. (calculate_pic_address_constant): New function. (legitimize_pic_address): Call calculate_pic_address_constant. (arm_load_pic_register): Handle TARGET_FDPIC. (arm_is_segment_info_known): New function. (arm_pic_static_addr): Add support for FDPIC. (arm_load_function_descriptor): New function. (arm_emit_call_insn): Add support for FDPIC. (arm_assemble_integer): Add support for FDPIC. * config/arm/arm.h (PIC_OFFSET_TABLE_REG_CALL_CLOBBERED): Define. (FDPIC_REGNUM): New define. * config/arm/arm.md (call): Add support for FDPIC. (call_value): Likewise. (restore_pic_register_after_call): New pattern. (untyped_call): Disable if FDPIC. (untyped_return): Likewise. * config/arm/unspecs.md (UNSPEC_PIC_RESTORE): New. gcc/testsuite/ * gcc.target/arm/fp16-aapcs-2.c: Adjust scan-assembler-times. * gcc.target/arm/fp16-aapcs-4.c: Likewise. Change-Id: I1e96d260074ab7b75d36cdff5d34ad898f35c66f diff --git a/gcc/config/arm/arm-c.c b/gcc/config/arm/arm-c.c index 6e256ee..34695fa 100644 --- a/gcc/config/arm/arm-c.c +++ b/gcc/config/arm/arm-c.c @@ -203,6 +203,8 @@ arm_cpu_builtins (struct cpp_reader* pfile) builtin_define ("__ARM_EABI__"); } + def_or_undef_macro (pfile, "__FDPIC__", TARGET_FDPIC); + def_or_undef_macro (pfile, "__ARM_ARCH_EXT_IDIV__", TARGET_IDIV); def_or_undef_macro (pfile, "__ARM_FEATURE_IDIV", TARGET_IDIV); diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h index 8386d89..f995974 100644 --- a/gcc/config/arm/arm-protos.h +++ b/gcc/config/arm/arm-protos.h @@ -139,6 +139,7 @@ extern int arm_max_const_double_inline_cost (void); extern int arm_const_double_inline_cost (rtx); extern bool arm_const_double_by_parts (rtx); extern bool arm_const_double_by_immediates (rtx); +extern rtx arm_load_function_descriptor (rtx funcdesc); extern void arm_emit_call_insn (rtx, rtx, bool); bool detect_cmse_nonsecure_call (tree); extern const char *output_call (rtx *); diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 8576431..c34aab8 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -3456,6 +3456,14 @@ arm_option_override (void) if (flag_pic && TARGET_VXWORKS_RTP) arm_pic_register = 9; + /* If in FDPIC mode then force arm_pic_register to be r9. */ + if (TARGET_FDPIC) + { + arm_pic_register = FDPIC_REGNUM; + if (TARGET_THUMB1) + sorry ("FDPIC mode is not supported in Thumb-1 mode"); + } + if (arm_pic_register_string != NULL) { int pic_register = decode_reg_name (arm_pic_register_string); @@ -7251,6 +7259,15 @@ arm_function_ok_for_sibcall (tree decl, tree exp) if (cfun->machine->sibcall_blocked) return false; + if (TARGET_FDPIC) + { + /* In FDPIC, never tailcall something for which we have no decl: + the target function could be in a different module, requiring + a different FDPIC register value. */ + if (decl == NULL) + return false; + } + /* Never tailcall something if we are generating code for Thumb-1. */ if (TARGET_THUMB1) return false; @@ -7461,6 +7478,24 @@ require_pic_register (rtx pic_reg, bool compute_now) } } +/* Generate insns to calculate the address of ORIG in pic mode. */ +static rtx_insn * +calculate_pic_address_constant (rtx reg, rtx pic_reg, rtx orig) +{ + rtx pat; + rtx mem; + + pat = gen_calculate_pic_address (reg, pic_reg, orig); + + /* Make the MEM as close to a constant as possible. */ + mem = SET_SRC (pat); + gcc_assert (MEM_P (mem) && !MEM_VOLATILE_P (mem)); + MEM_READONLY_P (mem) = 1; + MEM_NOTRAP_P (mem) = 1; + + return emit_insn (pat); +} + /* Legitimize PIC load to ORIG into REG. If REG is NULL, a new pseudo is created to hold the result of the load. If not NULL, PIC_REG indicates which register to use as PIC register, otherwise it is decided by register @@ -7505,24 +7540,13 @@ legitimize_pic_address (rtx orig, machine_mode mode, rtx reg, rtx pic_reg, insn = arm_pic_static_addr (orig, reg); else { - rtx pat; - rtx mem; - /* If this function doesn't have a pic register, create one now. */ require_pic_register (pic_reg, compute_now); if (pic_reg == NULL_RTX) pic_reg = cfun->machine->pic_reg; - pat = gen_calculate_pic_address (reg, pic_reg, orig); - - /* Make the MEM as close to a constant as possible. */ - mem = SET_SRC (pat); - gcc_assert (MEM_P (mem) && !MEM_VOLATILE_P (mem)); - MEM_READONLY_P (mem) = 1; - MEM_NOTRAP_P (mem) = 1; - - insn = emit_insn (pat); + insn = calculate_pic_address_constant (reg, pic_reg, orig); } /* Put a REG_EQUAL note on this insn, so that it can be optimized @@ -7677,7 +7701,9 @@ arm_load_pic_register (unsigned long saved_regs ATTRIBUTE_UNUSED, rtx pic_reg) { rtx l1, labelno, pic_tmp, pic_rtx; - if (crtl->uses_pic_offset_table == 0 || TARGET_SINGLE_PIC_BASE) + if (crtl->uses_pic_offset_table == 0 + || TARGET_SINGLE_PIC_BASE + || TARGET_FDPIC) return; gcc_assert (flag_pic); @@ -7746,28 +7772,128 @@ arm_load_pic_register (unsigned long saved_regs ATTRIBUTE_UNUSED, rtx pic_reg) emit_use (pic_reg); } +/* Try to determine whether an object, referenced via ORIG, will be + placed in the text or data segment. This is used in FDPIC mode, to + decide which relocations to use when accessing ORIG. *IS_READONLY + is set to true if ORIG is a read-only location, false otherwise. + Return true if we could determine the location of ORIG, false + otherwise. *IS_READONLY is valid only when we return true. */ +static bool +arm_is_segment_info_known (rtx orig, bool *is_readonly) +{ + *is_readonly = false; + + if (GET_CODE (orig) == LABEL_REF) + { + *is_readonly = true; + return true; + } + + if (SYMBOL_REF_P (orig)) + { + if (CONSTANT_POOL_ADDRESS_P (orig)) + { + *is_readonly = true; + return true; + } + if (SYMBOL_REF_LOCAL_P (orig) + && !SYMBOL_REF_EXTERNAL_P (orig) + && SYMBOL_REF_DECL (orig) + && (!DECL_P (SYMBOL_REF_DECL (orig)) + || !DECL_COMMON (SYMBOL_REF_DECL (orig)))) + { + tree decl = SYMBOL_REF_DECL (orig); + tree init = (TREE_CODE (decl) == VAR_DECL) + ? DECL_INITIAL (decl) : (TREE_CODE (decl) == CONSTRUCTOR) + ? decl : 0; + int reloc = 0; + bool named_section, readonly; + + if (init && init != error_mark_node) + reloc = compute_reloc_for_constant (init); + + named_section = TREE_CODE (decl) == VAR_DECL + && lookup_attribute ("section", DECL_ATTRIBUTES (decl)); + readonly = decl_readonly_section (decl, reloc); + + /* We don't know where the link script will put a named + section, so return false in such a case. */ + if (named_section) + return false; + + *is_readonly = readonly; + return true; + } + + /* We don't know. */ + return false; + } + + gcc_unreachable (); +} + /* Generate code to load the address of a static var when flag_pic is set. */ static rtx_insn * arm_pic_static_addr (rtx orig, rtx reg) { rtx l1, labelno, offset_rtx; + rtx_insn *insn; gcc_assert (flag_pic); - /* We use an UNSPEC rather than a LABEL_REF because this label - never appears in the code stream. */ - labelno = GEN_INT (pic_labelno++); - l1 = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, labelno), UNSPEC_PIC_LABEL); - l1 = gen_rtx_CONST (VOIDmode, l1); + bool is_readonly = false; + bool info_known = false; - /* On the ARM the PC register contains 'dot + 8' at the time of the - addition, on the Thumb it is 'dot + 4'. */ - offset_rtx = plus_constant (Pmode, l1, TARGET_ARM ? 8 : 4); - offset_rtx = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, orig, offset_rtx), - UNSPEC_SYMBOL_OFFSET); - offset_rtx = gen_rtx_CONST (Pmode, offset_rtx); + if (TARGET_FDPIC + && SYMBOL_REF_P (orig) + && !SYMBOL_REF_FUNCTION_P (orig)) + info_known = arm_is_segment_info_known (orig, &is_readonly); - return emit_insn (gen_pic_load_addr_unified (reg, offset_rtx, labelno)); + if (TARGET_FDPIC + && SYMBOL_REF_P (orig) + && !SYMBOL_REF_FUNCTION_P (orig) + && !info_known) + { + /* We don't know where orig is stored, so we have be + pessimistic and use a GOT relocation. */ + rtx pic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + + insn = calculate_pic_address_constant (reg, pic_reg, orig); + } + else if (TARGET_FDPIC + && SYMBOL_REF_P (orig) + && (SYMBOL_REF_FUNCTION_P (orig) + || !is_readonly)) + { + /* We use the GOTOFF relocation. */ + rtx pic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + + rtx l1 = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, orig), UNSPEC_PIC_SYM); + emit_insn (gen_movsi (reg, l1)); + insn = emit_insn (gen_addsi3 (reg, reg, pic_reg)); + } + else + { + /* Not FDPIC, not SYMBOL_REF_P or readonly: we can use + PC-relative access. */ + /* We use an UNSPEC rather than a LABEL_REF because this label + never appears in the code stream. */ + labelno = GEN_INT (pic_labelno++); + l1 = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, labelno), UNSPEC_PIC_LABEL); + l1 = gen_rtx_CONST (VOIDmode, l1); + + /* On the ARM the PC register contains 'dot + 8' at the time of the + addition, on the Thumb it is 'dot + 4'. */ + offset_rtx = plus_constant (Pmode, l1, TARGET_ARM ? 8 : 4); + offset_rtx = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, orig, offset_rtx), + UNSPEC_SYMBOL_OFFSET); + offset_rtx = gen_rtx_CONST (Pmode, offset_rtx); + + insn = emit_insn (gen_pic_load_addr_unified (reg, offset_rtx, + labelno)); + } + + return insn; } /* Return nonzero if X is valid as an ARM state addressing register. */ @@ -16051,9 +16177,32 @@ get_jump_table_size (rtx_jump_table_data *insn) return 0; } +/* Emit insns to load the function address from FUNCDESC (an FDPIC + function descriptor) into a register and the GOT address into the + FDPIC register, returning an rtx for the register holding the + function address. */ + +rtx +arm_load_function_descriptor (rtx funcdesc) +{ + rtx fnaddr_reg = gen_reg_rtx (Pmode); + rtx pic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + rtx fnaddr = gen_rtx_MEM (Pmode, funcdesc); + rtx gotaddr = gen_rtx_MEM (Pmode, plus_constant (Pmode, funcdesc, 4)); + + emit_move_insn (fnaddr_reg, fnaddr); + + /* The ABI requires the entry point address to be loaded first, but + since we cannot support lazy binding for lack of atomic load of + two 32-bits values, we do not need to bother to prevent the + previous load from being moved after that of the GOT address. */ + emit_insn (gen_restore_pic_register_after_call (pic_reg, gotaddr)); + + return fnaddr_reg; +} + /* Return the maximum amount of padding that will be inserted before label LABEL. */ - static HOST_WIDE_INT get_label_padding (rtx label) { @@ -18188,6 +18337,12 @@ arm_emit_call_insn (rtx pat, rtx addr, bool sibcall) use_reg (&CALL_INSN_FUNCTION_USAGE (insn), cfun->machine->pic_reg); } + if (TARGET_FDPIC) + { + rtx fdpic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + use_reg (&CALL_INSN_FUNCTION_USAGE (insn), fdpic_reg); + } + if (TARGET_AAPCS_BASED) { /* For AAPCS, IP and CC can be clobbered by veneers inserted by the @@ -23010,10 +23165,36 @@ arm_assemble_integer (rtx x, unsigned int size, int aligned_p) && (!SYMBOL_REF_LOCAL_P (x) || (SYMBOL_REF_DECL (x) ? DECL_WEAK (SYMBOL_REF_DECL (x)) : 0)))) - fputs ("(GOT)", asm_out_file); + { + if (TARGET_FDPIC && SYMBOL_REF_FUNCTION_P (x)) + fputs ("(GOTFUNCDESC)", asm_out_file); + else + fputs ("(GOT)", asm_out_file); + } else - fputs ("(GOTOFF)", asm_out_file); + { + if (TARGET_FDPIC && SYMBOL_REF_FUNCTION_P (x)) + fputs ("(GOTOFFFUNCDESC)", asm_out_file); + else + { + bool is_readonly; + + if (!TARGET_FDPIC + || arm_is_segment_info_known (x, &is_readonly)) + fputs ("(GOTOFF)", asm_out_file); + else + fputs ("(GOT)", asm_out_file); + } + } } + + /* For FDPIC we also have to mark symbol for .data section. */ + if (TARGET_FDPIC + && !making_const_table + && SYMBOL_REF_P (x) + && SYMBOL_REF_FUNCTION_P (x)) + fputs ("(FUNCDESC)", asm_out_file); + fputc ('\n', asm_out_file); return true; } diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 8b92c83..e404e2c 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -885,6 +885,9 @@ extern int arm_arch_cmse; Pascal), so the following is not true. */ #define STATIC_CHAIN_REGNUM 12 +/* r9 is the FDPIC register (base register for GOT and FUNCDESC accesses). */ +#define FDPIC_REGNUM 9 + /* Define this to be where the real frame pointer is if it is not possible to work out the offset between the frame pointer and the automatic variables until after register allocation has taken place. FRAME_POINTER_REGNUM @@ -1941,6 +1944,10 @@ extern unsigned arm_pic_register; data addresses in memory. */ #define PIC_OFFSET_TABLE_REGNUM arm_pic_register +/* For FDPIC, the FDPIC register is call-clobbered (otherwise PLT + entries would need to handle saving and restoring it). */ +#define PIC_OFFSET_TABLE_REG_CALL_CLOBBERED TARGET_FDPIC + /* We can't directly access anything that contains a symbol, nor can we indirect via the constant pool. One exception is UNSPEC_TLS, which is always PIC. */ diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index e236831..027febb 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -7601,6 +7601,11 @@ : !REG_P (callee)) XEXP (operands[0], 0) = force_reg (Pmode, callee); + if (TARGET_FDPIC && !SYMBOL_REF_P (XEXP (operands[0], 0))) + /* Indirect call: set r9 with FDPIC value of callee. */ + XEXP (operands[0], 0) + = arm_load_function_descriptor (XEXP (operands[0], 0)); + if (detect_cmse_nonsecure_call (addr)) { pat = gen_nonsecure_call_internal (operands[0], operands[1], @@ -7612,10 +7617,33 @@ pat = gen_call_internal (operands[0], operands[1], operands[2]); arm_emit_call_insn (pat, XEXP (operands[0], 0), false); } + + /* Restore FDPIC register (r9) after call. */ + if (TARGET_FDPIC) + { + rtx fdpic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + rtx initial_fdpic_reg + = get_hard_reg_initial_val (Pmode, FDPIC_REGNUM); + + emit_insn (gen_restore_pic_register_after_call (fdpic_reg, + initial_fdpic_reg)); + } + DONE; }" ) +(define_insn "restore_pic_register_after_call" + [(set (match_operand:SI 0 "s_register_operand" "+r,r") + (unspec:SI [(match_dup 0) + (match_operand:SI 1 "nonimmediate_operand" "r,m")] + UNSPEC_PIC_RESTORE))] + "" + "@ + mov\t%0, %1 + ldr\t%0, %1" +) + (define_expand "call_internal" [(parallel [(call (match_operand 0 "memory_operand") (match_operand 1 "general_operand")) @@ -7689,6 +7717,11 @@ : !REG_P (callee)) XEXP (operands[1], 0) = force_reg (Pmode, callee); + if (TARGET_FDPIC && !SYMBOL_REF_P (XEXP (operands[1], 0))) + /* Indirect call: set r9 with FDPIC value of callee. */ + XEXP (operands[1], 0) + = arm_load_function_descriptor (XEXP (operands[1], 0)); + if (detect_cmse_nonsecure_call (addr)) { pat = gen_nonsecure_call_value_internal (operands[0], operands[1], @@ -7701,6 +7734,18 @@ operands[2], operands[3]); arm_emit_call_insn (pat, XEXP (operands[1], 0), false); } + + /* Restore FDPIC register (r9) after call. */ + if (TARGET_FDPIC) + { + rtx fdpic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + rtx initial_fdpic_reg + = get_hard_reg_initial_val (Pmode, FDPIC_REGNUM); + + emit_insn (gen_restore_pic_register_after_call (fdpic_reg, + initial_fdpic_reg)); + } + DONE; }" ) @@ -8043,7 +8088,7 @@ (const_int 0)) (match_operand 1 "" "") (match_operand 2 "" "")])] - "TARGET_EITHER" + "TARGET_EITHER && !TARGET_FDPIC" " { int i; @@ -8110,7 +8155,7 @@ (define_expand "untyped_return" [(match_operand:BLK 0 "memory_operand") (match_operand 1 "" "")] - "TARGET_EITHER" + "TARGET_EITHER && !TARGET_FDPIC" " { int i; diff --git a/gcc/config/arm/unspecs.md b/gcc/config/arm/unspecs.md index 41068ba..a9f99d0 100644 --- a/gcc/config/arm/unspecs.md +++ b/gcc/config/arm/unspecs.md @@ -89,6 +89,7 @@ UNSPEC_SP_SET ; Represent the setting of stack protector's canary UNSPEC_SP_TEST ; Represent the testing of stack protector's canary ; against the guard. + UNSPEC_PIC_RESTORE ; Use to restore fdpic register ]) (define_c_enum "unspec" [ diff --git a/gcc/testsuite/gcc.target/arm/fp16-aapcs-2.c b/gcc/testsuite/gcc.target/arm/fp16-aapcs-2.c index 4753e36..51a76fc 100644 --- a/gcc/testsuite/gcc.target/arm/fp16-aapcs-2.c +++ b/gcc/testsuite/gcc.target/arm/fp16-aapcs-2.c @@ -17,5 +17,5 @@ F (__fp16 a, __fp16 b, __fp16 c) } /* { dg-final { scan-assembler-times {mov\tr[0-9]+, r[0-2]} 3 } } */ -/* { dg-final { scan-assembler-times {mov\tr1, r0} 1 } } */ +/* { dg-final { scan-assembler-times {mov\tr1, r[03]} 1 } } */ /* { dg-final { scan-assembler-times {mov\tr0, r[0-9]+} 2 } } */ diff --git a/gcc/testsuite/gcc.target/arm/fp16-aapcs-4.c b/gcc/testsuite/gcc.target/arm/fp16-aapcs-4.c index 41c7ab7..ae65fb8 100644 --- a/gcc/testsuite/gcc.target/arm/fp16-aapcs-4.c +++ b/gcc/testsuite/gcc.target/arm/fp16-aapcs-4.c @@ -16,5 +16,5 @@ F (__fp16 a, __fp16 b, __fp16 c) } /* { dg-final { scan-assembler-times {mov\tr[0-9]+, r[0-2]} 3 } } */ -/* { dg-final { scan-assembler-times {mov\tr1, r0} 1 } } */ +/* { dg-final { scan-assembler-times {mov\tr1, r[03]} 1 } } */ /* { dg-final { scan-assembler-times {mov\tr0, r[0-9]+} 2 } } */ From patchwork Mon Sep 9 15:44:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 1159806 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-508647-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="jPdU85Bp"; dkim=pass (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="GYXZCKYN"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46RsxF2m60z9s00 for ; Tue, 10 Sep 2019 01:47:29 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=Hk2 8gqWHtCPsSvP9dx0eUPnGVjOAlT1qWL6n3tM9M4j74tXoFhXBCZepbBd6OTIua5W YsyD+gtbffy6ftsBBOQuZ2gvbVfrQHlvuC9Ipcpq/MuFsS2EsOjLxd9gNMyycdWr rTCKCuJfLwBB9N53azPZLlpvbSYAIp3zA694xyQ0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=pRRi4DY7B mPTz3K6EHOkgfFhz3k=; b=jPdU85Bp1SFUVdIlw2IYAGVDid/chTbaHURbf0Cxa MGVGwboUM7iES8FIHe1A5sBDG85vGzPW2EXLSDC9owieAjx1ByU1NXGdGUf5J57P bPbz67wykCMcf6dScEBhQzcH5bn5QtInELSzuIG5W1LYu7dXeOcNVsoFEkSp0Zso KQ= Received: (qmail 116528 invoked by alias); 9 Sep 2019 15:47:21 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 116514 invoked by uid 89); 9 Sep 2019 15:47:21 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=__asm__, HContent-Transfer-Encoding:8bit X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:47:20 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FkPQO001291 for ; Mon, 9 Sep 2019 17:47:17 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=qzqjIa9m2glbaH0qse0GvzBJVtGVjy+4eBBdCp9fJhA=; b=GYXZCKYNrUp2KDYeEO/RzGna4t09dVBT3Xvms4GXZOSKfVkkzVoN2THTC3x7BMkXUaOV Zxnl0S1emxlXx+WpDGy4F3ge6sVEOD7ckwB3qxGeyu5GNNuAdFXM3b6Og0SM1tRMFDq4 EO2LxLhsUhA8GX40d/mwKaRJ6w+RSmKK3ua8aCKcCet3cepnpvRTXbzD2gE6jCwOv3HB DSdbS7i8ULftWop+8R/rPd/hQ0/nitJ07chUjY5xX4ATdj1K+juaIC/nEX0CZrty37eZ U+IyeA0cifnGytTZVNbpOxiP3LpwyGs0t9l11uus4XxZKnJU4Y5udGJ3ct0cMfh5PmCu AQ== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com with ESMTP id 2uv212ek6a-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:47:17 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id A7D734B for ; Mon, 9 Sep 2019 15:47:14 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 15E542B9BCC for ; Mon, 9 Sep 2019 17:47:14 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:47:13 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 05/24] [ARM] FDPIC: Fix __do_global_dtors_aux and frame_dummy generation Date: Mon, 9 Sep 2019 17:44:47 +0200 Message-ID: <20190909154526.11630-6-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon In FDPIC, we need to make sure __do_global_dtors_aux and frame_dummy are referenced by their address, not by pointers to the function descriptors. 2019-XX-XX Christophe Lyon Mickaël Guêné libgcc/ * libgcc/crtstuff.c: Add support for FDPIC. Change-Id: I0bc4b1232fbf3c69068fb23a1b9cafc895d141b1 diff --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c index c8a8e2c..c93e1cb 100644 --- a/libgcc/crtstuff.c +++ b/libgcc/crtstuff.c @@ -429,9 +429,17 @@ __do_global_dtors_aux (void) #ifdef FINI_SECTION_ASM_OP CRT_CALL_STATIC_FUNCTION (FINI_SECTION_ASM_OP, __do_global_dtors_aux) #elif defined (FINI_ARRAY_SECTION_ASM_OP) +#if defined(__FDPIC__) +__asm__("\t.equ\t__do_global_dtors_aux_alias, __do_global_dtors_aux\n"); +extern char __do_global_dtors_aux_alias; +static void *__do_global_dtors_aux_fini_array_entry[] +__attribute__ ((__used__, section(".fini_array"), aligned(sizeof(void *)))) + = { &__do_global_dtors_aux_alias }; +#else /* defined(__FDPIC__) */ static func_ptr __do_global_dtors_aux_fini_array_entry[] __attribute__ ((__used__, section(".fini_array"), aligned(__alignof__(func_ptr)))) = { __do_global_dtors_aux }; +#endif /* defined(__FDPIC__) */ #else /* !FINI_SECTION_ASM_OP && !FINI_ARRAY_SECTION_ASM_OP */ static void __attribute__((used)) __do_global_dtors_aux_1 (void) @@ -473,9 +481,17 @@ frame_dummy (void) #ifdef __LIBGCC_INIT_SECTION_ASM_OP__ CRT_CALL_STATIC_FUNCTION (__LIBGCC_INIT_SECTION_ASM_OP__, frame_dummy) #else /* defined(__LIBGCC_INIT_SECTION_ASM_OP__) */ +#if defined(__FDPIC__) +__asm__("\t.equ\t__frame_dummy_alias, frame_dummy\n"); +extern char __frame_dummy_alias; +static void *__frame_dummy_init_array_entry[] +__attribute__ ((__used__, section(".init_array"), aligned(sizeof(void *)))) + = { &__frame_dummy_alias }; +#else /* defined(__FDPIC__) */ static func_ptr __frame_dummy_init_array_entry[] __attribute__ ((__used__, section(".init_array"), aligned(__alignof__(func_ptr)))) = { frame_dummy }; +#endif /* defined(__FDPIC__) */ #endif /* !defined(__LIBGCC_INIT_SECTION_ASM_OP__) */ #endif /* USE_EH_FRAME_REGISTRY || USE_TM_CLONE_REGISTRY */ From patchwork Mon Sep 9 15:44:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 1159808 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-508648-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="ESNzf2JK"; dkim=pass (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="pEi5YLHw"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46Rsxf1tvjz9s00 for ; Tue, 10 Sep 2019 01:47:50 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=W2u K8nOKXJk//ZVLzbOiC+hDybE9t1EWKROdwGnG/TEsUDSLYK9V9W7t/P8QpGEq5cs xvvyLUy++9msTAtMfFZ0JRBhMjiCLvF+Pz/GMoNtx0y/BVTOTB7NqC0PS2YVIpkR NvondxnGvsh83EYUx39wNme+0xbMd796TE0gotas= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=s/AJvEzT3 A42WMEzKMYMIoVvUAo=; b=ESNzf2JKDXwhcunJnkw/hE97sVqbfUfR1tqVIKO6Q 0QcYpsBRC3HSbr7s8+S0elmuFADvC34Ewh3/odyKaTvibOD0fz4qvv7Tc6vWeDtP oxSzJSvbE+WxByU2S5LNNzPs68tS8O5DaYZ0pCNnogLcBonc9+ftT+4Z3CAq2iaa d4= Received: (qmail 118143 invoked by alias); 9 Sep 2019 15:47:42 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 118134 invoked by uid 89); 9 Sep 2019 15:47:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=xstr, Upload X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:47:40 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FkPQW001291 for ; Mon, 9 Sep 2019 17:47:38 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=XlTm03Sc8Z4WSnmQ3Ch8vcDaZFHEnjChx0QGLVQokx4=; b=pEi5YLHwPAteDfxB0IuvaNilV6kvmFpx6QsygaGbsdxfZr4lP8QHpo+3ohXqLxqHevVn fAr6m7Xgr+JVMr3hqK6kgc6d5TVHw4Q7LvacsHoylGM2b/7v7kNRpYgjiDeU8rahAtJC vciOM3pDwBe8bcWzXAavNoG2SMlwlucRp4wMZE0tLh91I6kwY+Yd3F13tCc0QMBRfO9L F33+yK1I8/mTx9lYGyWQuKgr00zRCmv/CS0Ah91jmMbSRJUsl9ijohL8f9xMBuKacpMV 1kRcoReP5G0oBBigCXwpzSAilVUFriqkeKzGo9cGhbfp/GgQJ+D35FX15ZLvOVXB54AC 7A== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com with ESMTP id 2uv212ek8a-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:47:37 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id DBF8324 for ; Mon, 9 Sep 2019 15:47:34 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 4CFA62B9BCE for ; Mon, 9 Sep 2019 17:47:34 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:47:34 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 06/24] [ARM] FDPIC: Add support for c++ exceptions Date: Mon, 9 Sep 2019 17:44:48 +0200 Message-ID: <20190909154526.11630-7-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon The main difference with existing support is that function addresses are function descriptor addresses instead. This means that all code dealing with function pointers now has to cope with function descriptors instead. For the same reason, Linux kernel helpers can no longer be called by dereferencing their address, so we implement wrappers that directly call the kernel helpers. When restoring a function address, we also have to restore the FDPIC register value (r9). 2019-XX-XX Christophe Lyon Mickaël Guêné gcc/ * ginclude/unwind-arm-common.h (unwinder_cache): Add reserved5 field. libgcc/ * config/arm/linux-atomic.c (__kernel_cmpxchg): Add FDPIC support. (__kernel_dmb): Likewise. (__fdpic_cmpxchg): New function. (__fdpic_dmb): New function. * config/arm/unwind-arm.h (FDPIC_REGNUM): New define. (gnu_Unwind_Find_got): New function. (_Unwind_decode_typeinfo_ptr): Add FDPIC support. * unwind-arm-common.inc (UCB_PR_GOT): New. (funcdesc_t): New struct. (get_eit_entry): Add FDPIC support. (unwind_phase2): Likewise. (unwind_phase2_forced): Likewise. (__gnu_Unwind_RaiseException): Likewise. (__gnu_Unwind_Resume): Likewise. (__gnu_Unwind_Backtrace): Likewise. * unwind-pe.h (read_encoded_value_with_base): Likewise. libstdc++/ * libsupc++/eh_personality.cc (get_ttype_entry): Add FDPIC support. Change-Id: I64b81cfaf390a05f2fd121f44ba1912cb4b47cae diff --git a/gcc/ginclude/unwind-arm-common.h b/gcc/ginclude/unwind-arm-common.h index 6df783e..d4eb03e 100644 --- a/gcc/ginclude/unwind-arm-common.h +++ b/gcc/ginclude/unwind-arm-common.h @@ -91,7 +91,7 @@ extern "C" { _uw reserved2; /* Personality routine address */ _uw reserved3; /* Saved callsite address */ _uw reserved4; /* Forced unwind stop arg */ - _uw reserved5; + _uw reserved5; /* Personality routine GOT value in FDPIC mode. */ } unwinder_cache; /* Propagation barrier cache (valid after phase 1): */ diff --git a/libgcc/config/arm/linux-atomic.c b/libgcc/config/arm/linux-atomic.c index 06a6d46..565f829 100644 --- a/libgcc/config/arm/linux-atomic.c +++ b/libgcc/config/arm/linux-atomic.c @@ -25,11 +25,62 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see /* Kernel helper for compare-and-exchange. */ typedef int (__kernel_cmpxchg_t) (int oldval, int newval, int *ptr); -#define __kernel_cmpxchg (*(__kernel_cmpxchg_t *) 0xffff0fc0) + +#define STR(X) #X +#define XSTR(X) STR(X) + +#define KERNEL_CMPXCHG 0xffff0fc0 + +#if __FDPIC__ +/* Non-FDPIC ABIs call __kernel_cmpxchg directly by dereferencing its + address, but under FDPIC we would generate a broken call + sequence. That's why we have to implement __kernel_cmpxchg and + __kernel_dmb here: this way, the FDPIC call sequence works. */ +#define __kernel_cmpxchg __fdpic_cmpxchg +#else +#define __kernel_cmpxchg (*(__kernel_cmpxchg_t *) KERNEL_CMPXCHG) +#endif /* Kernel helper for memory barrier. */ typedef void (__kernel_dmb_t) (void); -#define __kernel_dmb (*(__kernel_dmb_t *) 0xffff0fa0) + +#define KERNEL_DMB 0xffff0fa0 + +#if __FDPIC__ +#define __kernel_dmb __fdpic_dmb +#else +#define __kernel_dmb (*(__kernel_dmb_t *) KERNEL_DMB) +#endif + +#if __FDPIC__ +static int __fdpic_cmpxchg (int oldval, int newval, int *ptr) +{ + int result; + + asm volatile ( + "ldr ip, 1f\n\t" + "bx ip\n\t" + "1:\n\t" + ".word " XSTR(KERNEL_CMPXCHG) "\n\t" + : "=r" (result) + : "r" (oldval) , "r" (newval), "r" (ptr) + : "r3", "memory"); + /* The result is actually returned by the kernel helper, we need + this to avoid a warning. */ + return result; +} + +static void __fdpic_dmb (void) +{ + asm volatile ( + "ldr ip, 1f\n\t" + "bx ip\n\t" + "1:\n\t" + ".word " XSTR(KERNEL_DMB) "\n\t" + ); +} + +#endif /* Note: we implement byte, short and int versions of atomic operations using the above kernel helpers; see linux-atomic-64bit.c for "long long" (64-bit) diff --git a/libgcc/config/arm/unwind-arm.h b/libgcc/config/arm/unwind-arm.h index 43c5379..2bf320a 100644 --- a/libgcc/config/arm/unwind-arm.h +++ b/libgcc/config/arm/unwind-arm.h @@ -33,9 +33,33 @@ /* Use IP as a scratch register within the personality routine. */ #define UNWIND_POINTER_REG 12 +#define FDPIC_REGNUM 9 + +#define STR(x) #x +#define XSTR(x) STR(x) + #ifdef __cplusplus extern "C" { #endif +_Unwind_Ptr __attribute__((weak)) __gnu_Unwind_Find_got (_Unwind_Ptr); + +static inline _Unwind_Ptr gnu_Unwind_Find_got (_Unwind_Ptr ptr) +{ + _Unwind_Ptr res; + + if (__gnu_Unwind_Find_got) + res = __gnu_Unwind_Find_got (ptr); + else + { + asm volatile ("mov %[result], r" XSTR(FDPIC_REGNUM) + : [result]"=r" (res) + : + :); + } + + return res; +} + /* Decode an R_ARM_TARGET2 relocation. */ static inline _Unwind_Word _Unwind_decode_typeinfo_ptr (_Unwind_Word base __attribute__ ((unused)), @@ -48,7 +72,12 @@ extern "C" { if (!tmp) return 0; -#if (defined(linux) && !defined(__uClinux__)) || defined(__NetBSD__) \ +#if __FDPIC__ + /* For FDPIC, we store the offset of the GOT entry. */ + /* So, first get GOT from dynamic linker and then use indirect access. */ + tmp += gnu_Unwind_Find_got (ptr); + tmp = *(_Unwind_Word *) tmp; +#elif (defined(linux) && !defined(__uClinux__)) || defined(__NetBSD__) \ || defined(__FreeBSD__) || defined(__fuchsia__) /* Pc-relative indirect. */ #define _GLIBCXX_OVERRIDE_TTYPE_ENCODING (DW_EH_PE_pcrel | DW_EH_PE_indirect) diff --git a/libgcc/unwind-arm-common.inc b/libgcc/unwind-arm-common.inc index fd572fe..0bacc11 100644 --- a/libgcc/unwind-arm-common.inc +++ b/libgcc/unwind-arm-common.inc @@ -62,6 +62,7 @@ __gnu_Unwind_Find_exidx (_Unwind_Ptr, int *); #define UCB_PR_ADDR(ucbp) ((ucbp)->unwinder_cache.reserved2) #define UCB_SAVED_CALLSITE_ADDR(ucbp) ((ucbp)->unwinder_cache.reserved3) #define UCB_FORCED_STOP_ARG(ucbp) ((ucbp)->unwinder_cache.reserved4) +#define UCB_PR_GOT(ucbp) ((ucbp)->unwinder_cache.reserved5) /* Unwind descriptors. */ @@ -85,6 +86,16 @@ typedef struct __EIT_entry _uw content; } __EIT_entry; +#ifdef __FDPIC__ + +/* Only used in FDPIC case. */ +struct funcdesc_t +{ + unsigned int ptr; + unsigned int got; +}; +#endif + /* Assembly helper functions. */ /* Restore core register state. Never returns. */ @@ -259,7 +270,21 @@ get_eit_entry (_Unwind_Control_Block *ucbp, _uw return_address) { /* One of the predefined standard routines. */ _uw idx = (*(_uw *) ucbp->pr_cache.ehtp >> 24) & 0xf; +#if __FDPIC__ + { + struct funcdesc_t *funcdesc + = (struct funcdesc_t *) __gnu_unwind_get_pr_addr (idx); + if (funcdesc) + { + UCB_PR_ADDR (ucbp) = funcdesc->ptr; + UCB_PR_GOT (ucbp) = funcdesc->got; + } + else + UCB_PR_ADDR (ucbp) = 0; + } +#else UCB_PR_ADDR (ucbp) = __gnu_unwind_get_pr_addr (idx); +#endif if (UCB_PR_ADDR (ucbp) == 0) { /* Failed */ @@ -270,6 +295,10 @@ get_eit_entry (_Unwind_Control_Block *ucbp, _uw return_address) { /* Execute region offset to PR */ UCB_PR_ADDR (ucbp) = selfrel_offset31 (ucbp->pr_cache.ehtp); +#if __FDPIC__ + UCB_PR_GOT (ucbp) + = (unsigned int) gnu_Unwind_Find_got ((_Unwind_Ptr) UCB_PR_ADDR (ucbp)); +#endif } return _URC_OK; } @@ -291,14 +320,29 @@ unwind_phase2 (_Unwind_Control_Block * ucbp, phase2_vrs * vrs) UCB_SAVED_CALLSITE_ADDR (ucbp) = VRS_PC(vrs); /* Call the pr to decide what to do. */ +#if __FDPIC__ + { + volatile struct funcdesc_t funcdesc; + funcdesc.ptr = UCB_PR_ADDR (ucbp); + funcdesc.got = UCB_PR_GOT (ucbp); + pr_result = ((personality_routine) &funcdesc) + (_US_UNWIND_FRAME_STARTING, ucbp, (_Unwind_Context *) vrs); + } +#else pr_result = ((personality_routine) UCB_PR_ADDR (ucbp)) (_US_UNWIND_FRAME_STARTING, ucbp, (_Unwind_Context *) vrs); +#endif } while (pr_result == _URC_CONTINUE_UNWIND); if (pr_result != _URC_INSTALL_CONTEXT) abort(); +#if __FDPIC__ + /* r9 could have been lost due to PLT jump. Restore correct value. */ + vrs->core.r[FDPIC_REGNUM] = gnu_Unwind_Find_got (VRS_PC (vrs)); +#endif + uw_restore_core_regs (vrs, &vrs->core); } @@ -346,8 +390,18 @@ unwind_phase2_forced (_Unwind_Control_Block *ucbp, phase2_vrs *entry_vrs, next_vrs = saved_vrs; /* Call the pr to decide what to do. */ +#if __FDPIC__ + { + volatile struct funcdesc_t funcdesc; + funcdesc.ptr = UCB_PR_ADDR (ucbp); + funcdesc.got = UCB_PR_GOT (ucbp); + pr_result = ((personality_routine) &funcdesc) + (action, ucbp, (void *) &next_vrs); + } +#else pr_result = ((personality_routine) UCB_PR_ADDR (ucbp)) (action, ucbp, (void *) &next_vrs); +#endif saved_vrs.prev_sp = VRS_SP (&next_vrs); } @@ -384,6 +438,11 @@ unwind_phase2_forced (_Unwind_Control_Block *ucbp, phase2_vrs *entry_vrs, return _URC_FAILURE; } +#if __FDPIC__ + /* r9 could have been lost due to PLT jump. Restore correct value. */ + saved_vrs.core.r[FDPIC_REGNUM] = gnu_Unwind_Find_got (VRS_PC (&saved_vrs)); +#endif + uw_restore_core_regs (&saved_vrs, &saved_vrs.core); } @@ -429,8 +488,18 @@ __gnu_Unwind_RaiseException (_Unwind_Control_Block * ucbp, return _URC_FAILURE; /* Call the pr to decide what to do. */ +#if __FDPIC__ + { + volatile struct funcdesc_t funcdesc; + funcdesc.ptr = UCB_PR_ADDR (ucbp); + funcdesc.got = UCB_PR_GOT (ucbp); + pr_result = ((personality_routine) &funcdesc) + (_US_VIRTUAL_UNWIND_FRAME, ucbp, (void *) &saved_vrs); + } +#else pr_result = ((personality_routine) UCB_PR_ADDR (ucbp)) (_US_VIRTUAL_UNWIND_FRAME, ucbp, (void *) &saved_vrs); +#endif } while (pr_result == _URC_CONTINUE_UNWIND); @@ -488,13 +557,27 @@ __gnu_Unwind_Resume (_Unwind_Control_Block * ucbp, phase2_vrs * entry_vrs) } /* Call the cached PR. */ +#if __FDPIC__ + { + volatile struct funcdesc_t funcdesc; + funcdesc.ptr = UCB_PR_ADDR (ucbp); + funcdesc.got = UCB_PR_GOT (ucbp); + pr_result = ((personality_routine) &funcdesc) + (_US_UNWIND_FRAME_RESUME, ucbp, (_Unwind_Context *) entry_vrs); + } +#else pr_result = ((personality_routine) UCB_PR_ADDR (ucbp)) (_US_UNWIND_FRAME_RESUME, ucbp, (_Unwind_Context *) entry_vrs); +#endif switch (pr_result) { case _URC_INSTALL_CONTEXT: /* Upload the registers to enter the landing pad. */ +#if __FDPIC__ + /* r9 could have been lost due to PLT jump. Restore correct value. */ + entry_vrs->core.r[FDPIC_REGNUM] = gnu_Unwind_Find_got (VRS_PC (entry_vrs)); +#endif uw_restore_core_regs (entry_vrs, &entry_vrs->core); case _URC_CONTINUE_UNWIND: @@ -586,9 +669,20 @@ __gnu_Unwind_Backtrace(_Unwind_Trace_Fn trace, void * trace_argument, } /* Call the pr to decide what to do. */ +#if __FDPIC__ + { + volatile struct funcdesc_t funcdesc; + funcdesc.ptr = UCB_PR_ADDR (ucbp); + funcdesc.got = UCB_PR_GOT (ucbp); + code = ((personality_routine) &funcdesc) + (_US_VIRTUAL_UNWIND_FRAME | _US_FORCE_UNWIND, + ucbp, (void *) &saved_vrs); + } +#else code = ((personality_routine) UCB_PR_ADDR (ucbp)) (_US_VIRTUAL_UNWIND_FRAME | _US_FORCE_UNWIND, ucbp, (void *) &saved_vrs); +#endif } while (code != _URC_END_OF_STACK && code != _URC_FAILURE); diff --git a/libgcc/unwind-pe.h b/libgcc/unwind-pe.h index 4ed1c66..1c9dae5 100644 --- a/libgcc/unwind-pe.h +++ b/libgcc/unwind-pe.h @@ -262,10 +262,27 @@ read_encoded_value_with_base (unsigned char encoding, _Unwind_Ptr base, if (result != 0) { +#if __FDPIC__ + /* FDPIC relative addresses imply taking the GOT address + into account. */ + if ((encoding & DW_EH_PE_pcrel) && (encoding & DW_EH_PE_indirect)) + { + result += gnu_Unwind_Find_got ((_Unwind_Ptr) u); + result = *(_Unwind_Internal_Ptr *) result; + } + else + { + result += ((encoding & 0x70) == DW_EH_PE_pcrel + ? (_Unwind_Internal_Ptr) u : base); + if (encoding & DW_EH_PE_indirect) + result = *(_Unwind_Internal_Ptr *) result; + } +#else result += ((encoding & 0x70) == DW_EH_PE_pcrel ? (_Unwind_Internal_Ptr) u : base); if (encoding & DW_EH_PE_indirect) result = *(_Unwind_Internal_Ptr *) result; +#endif } } diff --git a/libstdc++-v3/libsupc++/eh_personality.cc b/libstdc++-v3/libsupc++/eh_personality.cc index 35e4e46..1528ab9 100644 --- a/libstdc++-v3/libsupc++/eh_personality.cc +++ b/libstdc++-v3/libsupc++/eh_personality.cc @@ -93,7 +93,15 @@ get_ttype_entry (lsda_header_info *info, _uleb128_t i) _Unwind_Ptr ptr; i *= size_of_encoded_value (info->ttype_encoding); - read_encoded_value_with_base (info->ttype_encoding, info->ttype_base, + read_encoded_value_with_base ( +#if __FDPIC__ + /* Force these flags to nake sure to + take the GOT into account. */ + (DW_EH_PE_pcrel | DW_EH_PE_indirect), +#else + info->ttype_encoding, +#endif + info->ttype_base, info->TType - i, &ptr); return reinterpret_cast(ptr); From patchwork Mon Sep 9 15:44:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 1159809 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-508649-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="TV6sCE2x"; dkim=pass (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="D/5z/hju"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46RsyP6MYSz9s7T for ; Tue, 10 Sep 2019 01:48:29 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=t45 5PVj5sU76YfiQhpaJmZb2ALaK4ZQ3BnxFd2sPcdzrcdUwd2dKco77tpCNwVzzJv3 9HM/4aEqf4dxFnfXed0djx/a5HYhnalVksGc66VMGJA/Q8zp8DY/5YOioGY9A8XS FauIMTCbM4gr6My/q675WaXfDQ0Q+mbN6v0iwSEM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=IKx+bANwj /12HV9mnDLvqrlqj7s=; b=TV6sCE2xXD5CezV0JwS2jqOkg2mlY0eirNuyY7aew 0yxHG56mPrgb1b7jpcyO9PGrD2E+4Cw/sbWFZ/74ctO+pjHxsjh1qdqx2YE9YzzE 9YNXdk6xWlzK38WLTAcBzthdpJyQ70Io7eva26GzIRXgyx4nhbv2z8Wx/um0KMo0 hQ= Received: (qmail 119753 invoked by alias); 9 Sep 2019 15:48:05 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 119735 invoked by uid 89); 9 Sep 2019 15:48:04 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx07-00178001.pphosted.com Received: from mx08-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (91.207.212.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:48:02 +0000 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FkGL6003551 for ; Mon, 9 Sep 2019 17:48:00 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=SxKKe98Y2GYALZtAEgj0v4RtmnDno7TAQiGjNsJrIOo=; b=D/5z/hjuAwxE7x3hG1BQ87hzomQCLTVFcygSlbHTf9mMUc2sLLUV6oWesOEZrL7jSdId Z4BOhxfofLR5UcXwXZVCk+NgZCEgmjjibLyA/59JDIRL7gsXP8wHb/X9QTrdr9kwpibu ebNXBfALWin1UZM9UxaUidaVw1+o7I5GYvrN6tVke2WUg+Vrz7U7wAlOxQ5/gEtmXFLU kWedNopaYxs0kjdKUJ0EXFMUiSxsyP8VtHMg+3FDhHmKAnE++2FMkOZWCIbizWJDHb8m UbYsGpAJp7lyCbFmq+vUEe2jr8/dVEWTdeT3IASGq5a1E9wXLkcyzVyssO1kbv2WY75k AQ== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx08-00178001.pphosted.com with ESMTP id 2uv1pa70mm-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:48:00 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 4854A24 for ; Mon, 9 Sep 2019 15:47:57 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 73FEA2B9BE2 for ; Mon, 9 Sep 2019 17:47:54 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:47:54 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 07/24] [ARM] FDPIC: Avoid saving/restoring r9 on stack since it is read-only Date: Mon, 9 Sep 2019 17:44:49 +0200 Message-ID: <20190909154526.11630-8-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon 2019-XX-XX Christophe Lyon Mickaël Guêné gcc/ * config/arm/arm.h (PIC_REGISTER_MAY_NEED_SAVING): New helper. * config/arm/arm.c (arm_compute_save_reg0_reg12_mask): Handle FDPIC. Change-Id: I0f3b2023ab2a2a0433dfe081dac6bbb194b7a76c diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index c34aab8..6ff3001 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -19571,9 +19571,7 @@ arm_compute_save_reg0_reg12_mask (void) save_reg_mask |= (1 << reg); /* Also save the pic base register if necessary. */ - if (flag_pic - && !TARGET_SINGLE_PIC_BASE - && arm_pic_register != INVALID_REGNUM + if (PIC_REGISTER_MAY_NEED_SAVING && crtl->uses_pic_offset_table) save_reg_mask |= 1 << PIC_OFFSET_TABLE_REGNUM; } @@ -19605,9 +19603,7 @@ arm_compute_save_reg0_reg12_mask (void) /* If we aren't loading the PIC register, don't stack it even though it may be live. */ - if (flag_pic - && !TARGET_SINGLE_PIC_BASE - && arm_pic_register != INVALID_REGNUM + if (PIC_REGISTER_MAY_NEED_SAVING && (df_regs_ever_live_p (PIC_OFFSET_TABLE_REGNUM) || crtl->uses_pic_offset_table)) save_reg_mask |= 1 << PIC_OFFSET_TABLE_REGNUM; diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index e404e2c..490d22d 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -1960,6 +1960,13 @@ extern unsigned arm_pic_register; || label_mentioned_p (get_pool_constant (X))))) \ || tls_mentioned_p (X)) +/* We may want to save the PIC register if it is a dedicated one. */ +#define PIC_REGISTER_MAY_NEED_SAVING \ + (flag_pic \ + && !TARGET_SINGLE_PIC_BASE \ + && !TARGET_FDPIC \ + && arm_pic_register != INVALID_REGNUM) + /* We need to know when we are making a constant pool; this determines whether data needs to be in the GOT or can be referenced via a GOT offset. */ From patchwork Mon Sep 9 15:44:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 1159810 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-508650-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="A/l7gk8h"; dkim=pass (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="T7jTqlMv"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46Rsyc6yZ0z9s00 for ; Tue, 10 Sep 2019 01:48:40 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=ZOO 6q+PqsP9RxeUEV35uUfWA0PPdr+8T6qiEAc2HsJUoJ3YpyYkL6CvAz0nuUN3i4Zi T4KjNwhvEP/jMHpvSldCEVoyowZg/GVOWlIrOLh5/tzgijAqUaWY1FN8HgtuVONt grtInmIVOUZQoo1yCKJYAttEaHsb13ogB/iSkF+M= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=CDsp7RsbC JhWTDXLCheX7UZz+P0=; b=A/l7gk8hmGINFkFEMBK9IAUFgMgo0QnEQClZWyY+E m5Wjlbw0Cer+14k/sK24bYDN0mcb/c1ddLrKmWMM5QDogZzdNaMIYneo9P8OimIk qNHUKpCQwGC2KWGsomtzq4M4Pall5/X61Obu4oDT1G8qtszgyv+lqhgLA+3J8E8A Bc= Received: (qmail 120060 invoked by alias); 9 Sep 2019 15:48:22 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 119926 invoked by uid 89); 9 Sep 2019 15:48:22 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_STOCKGEN, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx07-00178001.pphosted.com Received: from mx08-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (91.207.212.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:48:20 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FkgaZ027615 for ; Mon, 9 Sep 2019 17:48:18 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=CBXsndEM3gHUvnQ3DAtdTvD0g56U0EIb/mapmsA6e4M=; b=T7jTqlMvpmGbdHG2Y1TUQcHJqgun5bXd89u5eDPMgPZtZS/mNk3EhMis5n33vAbMput2 k5Zwdx/cXvQUCLliY0FY4lRo3hmROsHJ1VT8LEpyl3+Qt93mrNt3sAJvLap+CU1FfjQ4 OgnE35afOhdBgNxbvCzn+0PhoNGgxJlQeea+kDQKxJWStn31RU0qxRd4xsYxrYqLkNVP k4Kf1YE+78HJ7jSy9hHdbl4d8WcLL+xomE1gkH1SULJwVuCZd8r/TOaW2k982QHtBsIv l/28unVhSaOsvnEvgvTqQRRAE5sfhE2KN0EZCsNt2Thh/de8NIrXHIN4+ki2SNWMOC9K gA== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx08-00178001.pphosted.com with ESMTP id 2uv3ehpjqb-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:48:18 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 3F6A123 for ; Mon, 9 Sep 2019 15:48:15 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id A576C2B9BEE for ; Mon, 9 Sep 2019 17:48:14 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:48:14 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 08/24] [ARM] FDPIC: Enforce local/global binding for function descriptors Date: Mon, 9 Sep 2019 17:44:50 +0200 Message-ID: <20190909154526.11630-9-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon Use local binding rules to decide whether we can use GOTOFFFUNCDESC to compute the function address. 2019-XX-XX Christophe Lyon Mickaël Guêné gcc/ * config/arm/arm.c (arm_fdpic_local_funcdesc_p): New function. (legitimize_pic_address): Enforce binding rules on function pointers in FDPIC mode. (arm_assemble_integer): Likewise. Change-Id: I3fa0b63bc0f672903f405aa72cc46052de1c0feb diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 6ff3001..6b0c95f 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -3754,6 +3754,42 @@ arm_options_perform_arch_sanity_checks (void) } } +/* Test whether a local function descriptor is canonical, i.e., + whether we can use GOTOFFFUNCDESC to compute the address of the + function. */ +static bool +arm_fdpic_local_funcdesc_p (rtx fnx) +{ + tree fn; + enum symbol_visibility vis; + bool ret; + + if (!TARGET_FDPIC) + return true; + + if (! SYMBOL_REF_LOCAL_P (fnx)) + return false; + + fn = SYMBOL_REF_DECL (fnx); + + if (! fn) + return false; + + vis = DECL_VISIBILITY (fn); + + if (vis == VISIBILITY_PROTECTED) + /* Private function descriptors for protected functions are not + canonical. Temporarily change the visibility to global so that + we can ensure uniqueness of funcdesc pointers. */ + DECL_VISIBILITY (fn) = VISIBILITY_DEFAULT; + + ret = default_binds_local_p_1 (fn, flag_pic); + + DECL_VISIBILITY (fn) = vis; + + return ret; +} + static void arm_add_gc_roots (void) { @@ -7534,7 +7570,9 @@ legitimize_pic_address (rtx orig, machine_mode mode, rtx reg, rtx pic_reg, || (GET_CODE (orig) == SYMBOL_REF && SYMBOL_REF_LOCAL_P (orig) && (SYMBOL_REF_DECL (orig) - ? !DECL_WEAK (SYMBOL_REF_DECL (orig)) : 1))) + ? !DECL_WEAK (SYMBOL_REF_DECL (orig)) : 1) + && (!SYMBOL_REF_FUNCTION_P (orig) + || arm_fdpic_local_funcdesc_p (orig)))) && NEED_GOT_RELOC && arm_pic_data_is_text_relative) insn = arm_pic_static_addr (orig, reg); @@ -23160,7 +23198,9 @@ arm_assemble_integer (rtx x, unsigned int size, int aligned_p) || (GET_CODE (x) == SYMBOL_REF && (!SYMBOL_REF_LOCAL_P (x) || (SYMBOL_REF_DECL (x) - ? DECL_WEAK (SYMBOL_REF_DECL (x)) : 0)))) + ? DECL_WEAK (SYMBOL_REF_DECL (x)) : 0) + || (SYMBOL_REF_FUNCTION_P (x) + && !arm_fdpic_local_funcdesc_p (x))))) { if (TARGET_FDPIC && SYMBOL_REF_FUNCTION_P (x)) fputs ("(GOTFUNCDESC)", asm_out_file); From patchwork Mon Sep 9 15:44:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 1159811 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-508651-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="aA+ZIZiJ"; dkim=pass (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="esY/0CaO"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46Rsyx0TFFz9sNF for ; Tue, 10 Sep 2019 01:48:56 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=sn9 cUKu2PUtaHrdEydgmTZpZ/mIayofIA+R739o7HcnEZvzoeMxjZLDFUqzUx7/Nf4I 15dwMELUbxohtMeRsbXvF8ZSjU7Z2G6rtbRnl4bURTezpWO/BczXWxPc1JC81Qup wCnd54C4IunfNwu80pFRoZoVwnSHtUTu6JkGTXVE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=WJaEkxmiU Xfc8idxEO+icy8m/9A=; b=aA+ZIZiJD5ndS4xYqWGSu3EgeeA+dAgGnGsDieYA8 UpU4Ea6V3DYBQ5/6DwbCPYF48rmi5LLNWgjRrH4aYdyl5ukF9BUPWpC79jyOfWuW I9X4HjlNsyXJlLkdcWEOBdKX+e1pfUNQ5iGHCGd5Igtni+NcRxLhYIy2amYw9Oya dY= Received: (qmail 122907 invoked by alias); 9 Sep 2019 15:48:50 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 122899 invoked by uid 89); 9 Sep 2019 15:48:50 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=Arm, block_op_normal, emit_block_move, BLOCK_OP_NORMAL X-HELO: mx07-00178001.pphosted.com Received: from mx08-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (91.207.212.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:48:48 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FkhFe027618 for ; Mon, 9 Sep 2019 17:48:46 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=qSwSlsC1jddyg4w+tj74Rsaa3g06R/660Q/W3hv4LFI=; b=esY/0CaOU9C1p2tIyUct+SoSZf/9K510Yg+kYXM6P4PNYcXm28k9RSIiGVqNL8HP0ME9 KfwfPSxbujUXjQEVCwM8O/Z335krwLAYwJypY9bgOyZGncCsAc/KYnJ6wMnZ7iOhNK1X PwU1PgzkO9l+Vk9uo4Ba7PJ0TYiHlsT2kmzQi6wHoZFpFsokC3peBTjQp7KRbHYt033H l5Pt/STFCIT7BFqfEGzHppDZYmZ/NuN4Eoy6URmkHNsoN5TL3MuVXobqq/a3gObzEjGu /1HWaIn4meVrsGN8ruddQMjwTFWiFpeKfd34TinxY9rWVKITkcbkdKXVIB1iZBEvdXLr /Q== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx08-00178001.pphosted.com with ESMTP id 2uv3ehpjsh-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:48:46 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 9769D23 for ; Mon, 9 Sep 2019 15:48:35 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id DA3FE2ADEEE for ; Mon, 9 Sep 2019 17:48:34 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:48:34 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 09/24] [ARM] FDPIC: Add support for taking address of nested function Date: Mon, 9 Sep 2019 17:44:51 +0200 Message-ID: <20190909154526.11630-10-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon In FDPIC mode, the trampoline generated to support pointers to nested functions looks like: .word trampoline address .word trampoline GOT address ldr r12, [pc, #8] ldr r9, [pc, #8] ldr pc, [pc, #8] .word static chain value .word GOT address .word function's address because in FDPIC function pointers are actually pointers to function descriptors, we have to actually generate a function descriptor for the trampoline. 2019-XX-XX Christophe Lyon Mickaël Guêné gcc/ * config/arm/arm.c (arm_asm_trampoline_template): Add FDPIC support. (arm_trampoline_init): Likewise. (arm_trampoline_adjust_address): Likewise. * config/arm/arm.h (TRAMPOLINE_SIZE): Likewise. Change-Id: Idc4d5f629ae4f8d79bdf9623517481d524a0c144 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 6b0c95f..d01fae3 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -3939,14 +3939,52 @@ arm_warn_func_return (tree decl) ldr pc, [pc] .word static chain value .word function's address - XXX FIXME: When the trampoline returns, r8 will be clobbered. */ + XXX FIXME: When the trampoline returns, r8 will be clobbered. + + In FDPIC mode, the trampoline looks like: + .word trampoline address + .word trampoline GOT address + ldr r12, [pc, #8] ; #4 for Arm mode + ldr r9, [pc, #8] ; #4 for Arm mode + ldr pc, [pc, #8] ; #4 for Arm mode + .word static chain value + .word GOT address + .word function's address +*/ static void arm_asm_trampoline_template (FILE *f) { fprintf (f, "\t.syntax unified\n"); - if (TARGET_ARM) + if (TARGET_FDPIC) + { + /* The first two words are a function descriptor pointing to the + trampoline code just below. */ + if (TARGET_ARM) + fprintf (f, "\t.arm\n"); + else if (TARGET_THUMB2) + fprintf (f, "\t.thumb\n"); + else + /* Only ARM and Thumb-2 are supported. */ + gcc_unreachable (); + + assemble_aligned_integer (UNITS_PER_WORD, const0_rtx); + assemble_aligned_integer (UNITS_PER_WORD, const0_rtx); + /* Trampoline code which sets the static chain register but also + PIC register before jumping into real code. */ + asm_fprintf (f, "\tldr\t%r, [%r, #%d]\n", + STATIC_CHAIN_REGNUM, PC_REGNUM, + TARGET_THUMB2 ? 8 : 4); + asm_fprintf (f, "\tldr\t%r, [%r, #%d]\n", + PIC_OFFSET_TABLE_REGNUM, PC_REGNUM, + TARGET_THUMB2 ? 8 : 4); + asm_fprintf (f, "\tldr\t%r, [%r, #%d]\n", + PC_REGNUM, PC_REGNUM, + TARGET_THUMB2 ? 8 : 4); + assemble_aligned_integer (UNITS_PER_WORD, const0_rtx); + } + else if (TARGET_ARM) { fprintf (f, "\t.arm\n"); asm_fprintf (f, "\tldr\t%r, [%r, #0]\n", STATIC_CHAIN_REGNUM, PC_REGNUM); @@ -3987,12 +4025,40 @@ arm_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value) emit_block_move (m_tramp, assemble_trampoline_template (), GEN_INT (TRAMPOLINE_SIZE), BLOCK_OP_NORMAL); - mem = adjust_address (m_tramp, SImode, TARGET_32BIT ? 8 : 12); - emit_move_insn (mem, chain_value); + if (TARGET_FDPIC) + { + rtx funcdesc = XEXP (DECL_RTL (fndecl), 0); + rtx fnaddr = gen_rtx_MEM (Pmode, funcdesc); + rtx gotaddr = gen_rtx_MEM (Pmode, plus_constant (Pmode, funcdesc, 4)); + /* The function start address is at offset 8, but in Thumb mode + we want bit 0 set to 1 to indicate Thumb-ness, hence 9 + below. */ + rtx trampoline_code_start + = plus_constant (Pmode, XEXP (m_tramp, 0), TARGET_THUMB2 ? 9 : 8); + + /* Write initial funcdesc which points to the trampoline. */ + mem = adjust_address (m_tramp, SImode, 0); + emit_move_insn (mem, trampoline_code_start); + mem = adjust_address (m_tramp, SImode, 4); + emit_move_insn (mem, gen_rtx_REG (Pmode, PIC_OFFSET_TABLE_REGNUM)); + /* Setup static chain. */ + mem = adjust_address (m_tramp, SImode, 20); + emit_move_insn (mem, chain_value); + /* GOT + real function entry point. */ + mem = adjust_address (m_tramp, SImode, 24); + emit_move_insn (mem, gotaddr); + mem = adjust_address (m_tramp, SImode, 28); + emit_move_insn (mem, fnaddr); + } + else + { + mem = adjust_address (m_tramp, SImode, TARGET_32BIT ? 8 : 12); + emit_move_insn (mem, chain_value); - mem = adjust_address (m_tramp, SImode, TARGET_32BIT ? 12 : 16); - fnaddr = XEXP (DECL_RTL (fndecl), 0); - emit_move_insn (mem, fnaddr); + mem = adjust_address (m_tramp, SImode, TARGET_32BIT ? 12 : 16); + fnaddr = XEXP (DECL_RTL (fndecl), 0); + emit_move_insn (mem, fnaddr); + } a_tramp = XEXP (m_tramp, 0); emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), @@ -4006,7 +4072,9 @@ arm_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value) static rtx arm_trampoline_adjust_address (rtx addr) { - if (TARGET_THUMB) + /* For FDPIC don't fix trampoline address since it's a function + descriptor and not a function address. */ + if (TARGET_THUMB && !TARGET_FDPIC) addr = expand_simple_binop (Pmode, IOR, addr, const1_rtx, NULL, 0, OPTAB_LIB_WIDEN); return addr; diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 490d22d..8b67c9c 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -1595,7 +1595,7 @@ typedef struct #define INIT_EXPANDERS arm_init_expanders () /* Length in units of the trampoline for entering a nested function. */ -#define TRAMPOLINE_SIZE (TARGET_32BIT ? 16 : 20) +#define TRAMPOLINE_SIZE (TARGET_FDPIC ? 32 : (TARGET_32BIT ? 16 : 20)) /* Alignment required for a trampoline in bits. */ #define TRAMPOLINE_ALIGNMENT 32 From patchwork Mon Sep 9 15:44:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 1159812 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-508652-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="O1V1si9S"; dkim=pass (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="zN79hHbz"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46RszB4lyNz9s00 for ; Tue, 10 Sep 2019 01:49:10 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=As7 dtoNNFm/nwSbjYm3qYW0DP+RfNqCUuQ2xhFrJITgjg9GtzGPKgRxWeAOSM8vc2xv jMaVdBGB32yPfWPXz33Re3Aa3B5CI07E0keW2bl742ZDhdXWyTjCZ4DIiT0vBdxw d0ik/2k3gd9uI1HiZTi+xemM+VPZXPj4AcB8s0u0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=cZz02wVX6 vtlbAJ9fzFexcwN2gI=; b=O1V1si9SQ4jFDh0xlGPAsI5iiRxsOvDOQswGExwKn uL1I9DkIpwGn5HyKme634So3WnT2T2/XeRyjd6thM0JetlUlo5bmUdcMwJdREo9Z 7ucgSFEG57A50WMtrsOE2ZCxRboMtRZPy3pGo2IDSCXHR26JE/LUpEmTGm3B2MKL +A= Received: (qmail 124334 invoked by alias); 9 Sep 2019 15:49:03 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 124326 invoked by uid 89); 9 Sep 2019 15:49:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx07-00178001.pphosted.com Received: from mx08-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (91.207.212.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:49:00 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89Fkj7a027635 for ; Mon, 9 Sep 2019 17:48:58 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=A7EMVHVTS6bPrQssozG6OlLSlmc8mcwhOV1nfWF1Y/g=; b=zN79hHbzWZ/0V4Sln89GedikvCPpvFBRb7tcmXR2LZKpihC+7P4ONkPGbSYdtBVzJYe7 2gU7OcRDrrJqyq1hP9mnI9Oy+G1JTXA4HrW2PnruTBfL/ONQnCWYrQ6Q06P6Nb3EvRjz +7d9o0xTH7TdvrBQUHFfo7JH208/+57TwVfwoixHy1+w9jd2P0o6r5A4X3xkkFnMk6it HK5o/j58lvmQh6GpuDXkXIP9Cf5ipKzOe6F6LQkGPDBO5CT0MqpOGM3depBMcx02HaC1 CZ/h92O2T6/IOMJSqeNsWhvyXPzu0wOm2naw+Uz7HoNyLqs94yjfXLi5jqJifHYJa7F5 wA== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx08-00178001.pphosted.com with ESMTP id 2uv3ehpjtu-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:48:58 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id ADE364C for ; Mon, 9 Sep 2019 15:48:55 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 1939A2B9BFA for ; Mon, 9 Sep 2019 17:48:55 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:48:54 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 10/24] [ARM] FDPIC: Implement TLS support. Date: Mon, 9 Sep 2019 17:44:52 +0200 Message-ID: <20190909154526.11630-11-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon Support additional relocations: TLS_GD32_FDPIC, TLS_LDM32_FDPIC, and TLS_IE32_FDPIC. We do not support the GNU2 TLS dialect. 2019-XX-XX Christophe Lyon Mickaël Guêné gcc/ * config/arm/arm.c (tls_reloc): Add TLS_GD32_FDPIC, TLS_LDM32_FDPIC and TLS_IE32_FDPIC. (arm_call_tls_get_addr): Add FDPIC support. (legitimize_tls_address): Likewise. (arm_emit_tls_decoration): Likewise. Change-Id: I4ea5034ff654540c4658d0a79fb92f70550cdf4a diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index d01fae3..5f1d2d4 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -2350,9 +2350,12 @@ char arm_arch_name[] = "__ARM_ARCH_PROFILE__"; enum tls_reloc { TLS_GD32, + TLS_GD32_FDPIC, TLS_LDM32, + TLS_LDM32_FDPIC, TLS_LDO32, TLS_IE32, + TLS_IE32_FDPIC, TLS_LE32, TLS_DESCSEQ /* GNU scheme */ }; @@ -8708,22 +8711,33 @@ load_tls_operand (rtx x, rtx reg) static rtx_insn * arm_call_tls_get_addr (rtx x, rtx reg, rtx *valuep, int reloc) { - rtx label, labelno, sum; + rtx label, labelno = NULL_RTX, sum; gcc_assert (reloc != TLS_DESCSEQ); start_sequence (); - labelno = GEN_INT (pic_labelno++); - label = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, labelno), UNSPEC_PIC_LABEL); - label = gen_rtx_CONST (VOIDmode, label); + if (TARGET_FDPIC) + { + sum = gen_rtx_UNSPEC (Pmode, + gen_rtvec (2, x, GEN_INT (reloc)), + UNSPEC_TLS); + } + else + { + labelno = GEN_INT (pic_labelno++); + label = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, labelno), UNSPEC_PIC_LABEL); + label = gen_rtx_CONST (VOIDmode, label); - sum = gen_rtx_UNSPEC (Pmode, - gen_rtvec (4, x, GEN_INT (reloc), label, - GEN_INT (TARGET_ARM ? 8 : 4)), - UNSPEC_TLS); + sum = gen_rtx_UNSPEC (Pmode, + gen_rtvec (4, x, GEN_INT (reloc), label, + GEN_INT (TARGET_ARM ? 8 : 4)), + UNSPEC_TLS); + } reg = load_tls_operand (sum, reg); - if (TARGET_ARM) + if (TARGET_FDPIC) + emit_insn (gen_addsi3 (reg, reg, gen_rtx_REG (Pmode, FDPIC_REGNUM))); + else if (TARGET_ARM) emit_insn (gen_pic_add_dot_plus_eight (reg, reg, labelno)); else emit_insn (gen_pic_add_dot_plus_four (reg, reg, labelno)); @@ -8761,6 +8775,7 @@ arm_tls_descseq_addr (rtx x, rtx reg) return reg; } + rtx legitimize_tls_address (rtx x, rtx reg) { @@ -8773,6 +8788,8 @@ legitimize_tls_address (rtx x, rtx reg) case TLS_MODEL_GLOBAL_DYNAMIC: if (TARGET_GNU2_TLS) { + gcc_assert (!TARGET_FDPIC); + reg = arm_tls_descseq_addr (x, reg); tp = arm_load_tp (NULL_RTX); @@ -8782,7 +8799,10 @@ legitimize_tls_address (rtx x, rtx reg) else { /* Original scheme */ - insns = arm_call_tls_get_addr (x, reg, &ret, TLS_GD32); + if (TARGET_FDPIC) + insns = arm_call_tls_get_addr (x, reg, &ret, TLS_GD32_FDPIC); + else + insns = arm_call_tls_get_addr (x, reg, &ret, TLS_GD32); dest = gen_reg_rtx (Pmode); emit_libcall_block (insns, dest, ret, x); } @@ -8791,6 +8811,8 @@ legitimize_tls_address (rtx x, rtx reg) case TLS_MODEL_LOCAL_DYNAMIC: if (TARGET_GNU2_TLS) { + gcc_assert (!TARGET_FDPIC); + reg = arm_tls_descseq_addr (x, reg); tp = arm_load_tp (NULL_RTX); @@ -8799,7 +8821,10 @@ legitimize_tls_address (rtx x, rtx reg) } else { - insns = arm_call_tls_get_addr (x, reg, &ret, TLS_LDM32); + if (TARGET_FDPIC) + insns = arm_call_tls_get_addr (x, reg, &ret, TLS_LDM32_FDPIC); + else + insns = arm_call_tls_get_addr (x, reg, &ret, TLS_LDM32); /* Attach a unique REG_EQUIV, to allow the RTL optimizers to share the LDM result with other LD model accesses. */ @@ -8818,23 +8843,35 @@ legitimize_tls_address (rtx x, rtx reg) return dest; case TLS_MODEL_INITIAL_EXEC: - labelno = GEN_INT (pic_labelno++); - label = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, labelno), UNSPEC_PIC_LABEL); - label = gen_rtx_CONST (VOIDmode, label); - sum = gen_rtx_UNSPEC (Pmode, - gen_rtvec (4, x, GEN_INT (TLS_IE32), label, - GEN_INT (TARGET_ARM ? 8 : 4)), - UNSPEC_TLS); - reg = load_tls_operand (sum, reg); - - if (TARGET_ARM) - emit_insn (gen_tls_load_dot_plus_eight (reg, reg, labelno)); - else if (TARGET_THUMB2) - emit_insn (gen_tls_load_dot_plus_four (reg, NULL, reg, labelno)); + if (TARGET_FDPIC) + { + sum = gen_rtx_UNSPEC (Pmode, + gen_rtvec (2, x, GEN_INT (TLS_IE32_FDPIC)), + UNSPEC_TLS); + reg = load_tls_operand (sum, reg); + emit_insn (gen_addsi3 (reg, reg, gen_rtx_REG (Pmode, FDPIC_REGNUM))); + emit_move_insn (reg, gen_rtx_MEM (Pmode, reg)); + } else { - emit_insn (gen_pic_add_dot_plus_four (reg, reg, labelno)); - emit_move_insn (reg, gen_const_mem (SImode, reg)); + labelno = GEN_INT (pic_labelno++); + label = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, labelno), UNSPEC_PIC_LABEL); + label = gen_rtx_CONST (VOIDmode, label); + sum = gen_rtx_UNSPEC (Pmode, + gen_rtvec (4, x, GEN_INT (TLS_IE32), label, + GEN_INT (TARGET_ARM ? 8 : 4)), + UNSPEC_TLS); + reg = load_tls_operand (sum, reg); + + if (TARGET_ARM) + emit_insn (gen_tls_load_dot_plus_eight (reg, reg, labelno)); + else if (TARGET_THUMB2) + emit_insn (gen_tls_load_dot_plus_four (reg, NULL, reg, labelno)); + else + { + emit_insn (gen_pic_add_dot_plus_four (reg, reg, labelno)); + emit_move_insn (reg, gen_const_mem (SImode, reg)); + } } tp = arm_load_tp (NULL_RTX); @@ -28158,15 +28195,24 @@ arm_emit_tls_decoration (FILE *fp, rtx x) case TLS_GD32: fputs ("(tlsgd)", fp); break; + case TLS_GD32_FDPIC: + fputs ("(tlsgd_fdpic)", fp); + break; case TLS_LDM32: fputs ("(tlsldm)", fp); break; + case TLS_LDM32_FDPIC: + fputs ("(tlsldm_fdpic)", fp); + break; case TLS_LDO32: fputs ("(tlsldo)", fp); break; case TLS_IE32: fputs ("(gottpoff)", fp); break; + case TLS_IE32_FDPIC: + fputs ("(gottpoff_fdpic)", fp); + break; case TLS_LE32: fputs ("(tpoff)", fp); break; From patchwork Mon Sep 9 15:44:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 1159814 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-508653-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="V9Nduwj5"; dkim=pass (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="kugZev0r"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46RszZ0Hbwz9s00 for ; Tue, 10 Sep 2019 01:49:29 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=wvF HGEKdhOxghKYDPkVmvdttUFnBuNqIfMEcvjE0tT5zA5EOL/MXo+wtHZyyBSPSNSM E7LEcxBQs5tlG56z5yeSy1oigCCrDs6b1hWHqDMHLLAqXsZZOY1fnmOkZqALkLIs g51rRX+zjAMScUfR1fDGxi881RojShSU4x7Gbjxo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=TrpIQZavf 2ocQhqk5whiT2GuDrI=; b=V9Nduwj5YsnpMqPszT2EERKx6nFPPWF3j3Uld4x8O vzedOJICVyGQEdDhKpGud/pY1v7ttQTPG6HlY0nYjPlf7Seh6VOK0AMOQ6hdYv5V GJ1AifXW7YuyPy/GunOrzioMC2mMGclA/BPFT/ihMhIfNE9g173JA39Al8TdR7Eh Jc= Received: (qmail 125808 invoked by alias); 9 Sep 2019 15:49:22 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 125800 invoked by uid 89); 9 Sep 2019 15:49:22 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=Signal X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:49:21 +0000 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FkMUK001843 for ; Mon, 9 Sep 2019 17:49:18 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=M8viSaljgtCHVByPY0WiITc4Xf+vuqFXi7mQ+OLT1aE=; b=kugZev0ra8SsvtkVHF0vTvhjzZ7SzYSVht5NPu4x/2M3Sl3FiRU7KcdVrgZX7KzKcSyy GGoyYMuviEOeo249rq68b+CC9bfIpMJdbuVQsmLTeuHFYYKA3eZLRRW9AsF0MmyInvtw j8i5yXmGNozZ6orY95vGnLSuDnp3uSHdTxp8k9Z7ByXKyB2Oq4yIiKo83EFlJckZwZ+8 iftqW53lPHBqCvDVs6ZSHzIXq6y/WtMCVLq2aU86FJy8QRlUi6A7/SEa1VFTEZ4/Jg4q G1ZSEl96zSu4MYRskjgLtOArmcLKBSyLVHhncfK5eM2NJL6iDN5geofd6ckqZPQjjwwL AA== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com with ESMTP id 2uv2avxhf1-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:49:18 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id D2D2B22 for ; Mon, 9 Sep 2019 15:49:15 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 43DBB2ADF1E for ; Mon, 9 Sep 2019 17:49:15 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:49:15 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 11/24] [ARM] FDPIC: Add support to unwind FDPIC signal frame Date: Mon, 9 Sep 2019 17:44:53 +0200 Message-ID: <20190909154526.11630-12-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon 2019-XX-XX Christophe Lyon Mickaël Guêné libgcc/ * unwind-arm-common.inc (ARM_SET_R7_RT_SIGRETURN) (THUMB2_SET_R7_RT_SIGRETURN, FDPIC_LDR_R12_WITH_FUNCDESC) (FDPIC_LDR_R9_WITH_GOT, FDPIC_LDR_PC_WITH_RESTORER) (FDPIC_FUNCDESC_OFFSET, ARM_NEW_RT_SIGFRAME_UCONTEXT) (ARM_UCONTEXT_SIGCONTEXT, ARM_SIGCONTEXT_R0, FDPIC_T2_LDR_R12_WITH_FUNCDESC) (FDPIC_T2_LDR_R9_WITH_GOT, FDPIC_T2_LDR_PC_WITH_RESTORER): New. (__gnu_personality_sigframe_fdpic): New. (get_eit_entry): Add FDPIC signal frame support. Change-Id: I7f9527cc50665dd1a731b7badf71c319fb38bf57 diff --git a/libgcc/unwind-arm-common.inc b/libgcc/unwind-arm-common.inc index 0bacc11..c9a82b7 100644 --- a/libgcc/unwind-arm-common.inc +++ b/libgcc/unwind-arm-common.inc @@ -30,6 +30,26 @@ #include #endif +#if __FDPIC__ +/* Load r7 with rt_sigreturn value. */ +#define ARM_SET_R7_RT_SIGRETURN 0xe3a070ad /* mov r7, #0xad */ +#define THUMB2_SET_R7_RT_SIGRETURN 0x07adf04f /* mov.w r7, #0xad */ + +/* FDPIC jump to restorer sequence. */ +#define FDPIC_LDR_R12_WITH_FUNCDESC 0xe59fc004 /* ldr r12, [pc, #4] */ +#define FDPIC_LDR_R9_WITH_GOT 0xe59c9004 /* ldr r9, [r12, #4] */ +#define FDPIC_LDR_PC_WITH_RESTORER 0xe59cf000 /* ldr pc, [r12] */ +#define FDPIC_T2_LDR_R12_WITH_FUNCDESC 0xc008f8df /* ldr.w r12, [pc, #8] */ +#define FDPIC_T2_LDR_R9_WITH_GOT 0x9004f8dc /* ldr.w r9, [r12, #4] */ +#define FDPIC_T2_LDR_PC_WITH_RESTORER 0xf000f8dc /* ldr.w pc, [r12] */ +#define FDPIC_FUNCDESC_OFFSET 12 + +/* Signal frame offsets. */ +#define ARM_NEW_RT_SIGFRAME_UCONTEXT 0x80 +#define ARM_UCONTEXT_SIGCONTEXT 0x14 +#define ARM_SIGCONTEXT_R0 0xc +#endif + /* We add a prototype for abort here to avoid creating a dependency on target headers. */ extern void abort (void); @@ -199,6 +219,45 @@ search_EIT_table (const __EIT_entry * table, int nrec, _uw return_address) } } +#if __FDPIC__ +/* VFP is not restored, but this is sufficient to allow unwinding. */ +static _Unwind_Reason_Code +__gnu_personality_sigframe_fdpic (_Unwind_State state, + _Unwind_Control_Block *ucbp, + _Unwind_Context *context) +{ + unsigned int sp; + unsigned int pc; + unsigned int funcdesc; + unsigned int handler; + unsigned int first_handler_instruction; + int i; + + _Unwind_VRS_Get (context, _UVRSC_CORE, R_SP, _UVRSD_UINT32, &sp); + _Unwind_VRS_Get (context, _UVRSC_CORE, R_PC, _UVRSD_UINT32, &pc); + + funcdesc = *(unsigned int *)((pc & ~1) + FDPIC_FUNCDESC_OFFSET); + handler = *(unsigned int *)(funcdesc); + first_handler_instruction = *(unsigned int *)(handler & ~1); + + /* Adjust SP to point to the start of registers according to + signal type. */ + if (first_handler_instruction == ARM_SET_R7_RT_SIGRETURN + || first_handler_instruction == THUMB2_SET_R7_RT_SIGRETURN) + sp += ARM_NEW_RT_SIGFRAME_UCONTEXT + + ARM_UCONTEXT_SIGCONTEXT + + ARM_SIGCONTEXT_R0; + else + sp += ARM_UCONTEXT_SIGCONTEXT + + ARM_SIGCONTEXT_R0; + /* Restore regs saved on stack by the kernel. */ + for (i = 0; i < 16; i++) + _Unwind_VRS_Set (context, _UVRSC_CORE, i, _UVRSD_UINT32, sp + 4 * i); + + return _URC_CONTINUE_UNWIND; +} +#endif + /* Find the exception index table eintry for the given address. Fill in the relevant fields of the UCB. Returns _URC_FAILURE if an error occurred, _URC_OK on success. */ @@ -222,6 +281,27 @@ get_eit_entry (_Unwind_Control_Block *ucbp, _uw return_address) &nrec); if (!eitp) { +#if __FDPIC__ + /* If we are unwinding a signal handler then perhaps we have + reached a trampoline. Try to detect jump to restorer + sequence. */ + _uw *pc = (_uw *)((return_address+2) & ~1); + if ((pc[0] == FDPIC_LDR_R12_WITH_FUNCDESC + && pc[1] == FDPIC_LDR_R9_WITH_GOT + && pc[2] == FDPIC_LDR_PC_WITH_RESTORER) + || (pc[0] == FDPIC_T2_LDR_R12_WITH_FUNCDESC + && pc[1] == FDPIC_T2_LDR_R9_WITH_GOT + && pc[2] == FDPIC_T2_LDR_PC_WITH_RESTORER)) + { + struct funcdesc_t *funcdesc + = (struct funcdesc_t *) &__gnu_personality_sigframe_fdpic; + + UCB_PR_ADDR (ucbp) = funcdesc->ptr; + UCB_PR_GOT (ucbp) = funcdesc->got; + + return _URC_OK; + } +#endif UCB_PR_ADDR (ucbp) = 0; return _URC_FAILURE; } @@ -236,6 +316,27 @@ get_eit_entry (_Unwind_Control_Block *ucbp, _uw return_address) if (!eitp) { +#if __FDPIC__ + /* If we are unwinding a signal handler then perhaps we have + reached a trampoline. Try to detect jump to restorer + sequence. */ + _uw *pc = (_uw *)((return_address+2) & ~1); + if ((pc[0] == FDPIC_LDR_R12_WITH_FUNCDESC + && pc[1] == FDPIC_LDR_R9_WITH_GOT + && pc[2] == FDPIC_LDR_PC_WITH_RESTORER) + || (pc[0] == FDPIC_T2_LDR_R12_WITH_FUNCDESC + && pc[1] == FDPIC_T2_LDR_R9_WITH_GOT + && pc[2] == FDPIC_T2_LDR_PC_WITH_RESTORER)) + { + struct funcdesc_t *funcdesc + = (struct funcdesc_t *) &__gnu_personality_sigframe_fdpic; + + UCB_PR_ADDR (ucbp) = funcdesc->ptr; + UCB_PR_GOT (ucbp) = funcdesc->got; + + return _URC_OK; + } +#endif UCB_PR_ADDR (ucbp) = 0; return _URC_FAILURE; } @@ -244,6 +345,27 @@ get_eit_entry (_Unwind_Control_Block *ucbp, _uw return_address) /* Can this frame be unwound at all? */ if (eitp->content == EXIDX_CANTUNWIND) { +#if __FDPIC__ + /* If we are unwinding a signal handler then perhaps we have + reached a trampoline. Try to detect jump to restorer + sequence. */ + _uw *pc = (_uw *)((return_address+2) & ~1); + if ((pc[0] == FDPIC_LDR_R12_WITH_FUNCDESC + && pc[1] == FDPIC_LDR_R9_WITH_GOT + && pc[2] == FDPIC_LDR_PC_WITH_RESTORER) + || (pc[0] == FDPIC_T2_LDR_R12_WITH_FUNCDESC + && pc[1] == FDPIC_T2_LDR_R9_WITH_GOT + && pc[2] == FDPIC_T2_LDR_PC_WITH_RESTORER)) + { + struct funcdesc_t *funcdesc + = (struct funcdesc_t *) &__gnu_personality_sigframe_fdpic; + + UCB_PR_ADDR (ucbp) = funcdesc->ptr; + UCB_PR_GOT (ucbp) = funcdesc->got; + + return _URC_OK; + } +#endif UCB_PR_ADDR (ucbp) = 0; return _URC_END_OF_STACK; } From patchwork Mon Sep 9 15:44:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 1159815 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-508654-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="gKbO58qS"; dkim=pass (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="MxYTLxmi"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46Rszx3qmvz9sCJ for ; Tue, 10 Sep 2019 01:49:49 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=fs6 mLBUBhKyUBobwYVtUMDOIAYbqYoCwo5wtQVf/cJRPg8MwGqQWjCcVgJ63Qk39wg9 EVlkWvP2SjLGaDNNFzCKFXt/Xv4gxz1X7S5s87i0l7uQg7jFHdK7LIRAw9fwHLlP HeKRQ8tsKfppJ8caBQSDKT2pRFA7KoqeXJAU7uXg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=O8JmIjq5n AuKVD+Yww7uzwmAT38=; b=gKbO58qSClJ1JLxUVWMIQKhLktrSp0z1HmQAyBZuP 6iEJUiTpIlzhbBFd8N+BT49x8nWppvANABgV9RO0r8tcOHc8L/HglIIqW1r3HI3V Ab+EAeIe5VqgAUZQHc/MAQwfn0Sdv5KG0xvC+SVZUCE40/f5YykQOEJqcBhza4f/ 4g= Received: (qmail 127336 invoked by alias); 9 Sep 2019 15:49:43 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 127328 invoked by uid 89); 9 Sep 2019 15:49:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:49:41 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FkKNK001257 for ; Mon, 9 Sep 2019 17:49:39 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=UjTVxNi35+SWpXUmMrOWcjwiZYhMTbLA3TwIKHC/6qA=; b=MxYTLxmiDbxmNeLYfqIHSnC/PD6ahrXZPvxvJJygMnV69VmLopFfSj1p1S0hxgP2iNIZ SezYRlLfXRVtF2qAh2ZpLSudBW2rYZxulnGRbaAwlnTsIELpmHDI7w0L16TCutHACZsx S/lO5EygXLnMIcRohwo7rBV3PG97sM2e32FLC4HO2Xo6AMdgtKCoXJC1+tRPsHxVcQGi CJp2c44+S3Wk+5mxv0LOdHHVvrVhL4DB/4d0DAInLy4mvbrxh/QIRkeGtZuufGI9UQSJ U8fPrEAnC11GT/f7AS7XqrHG6TrZT0b6qBqNoeP5mIQntlQcTOGR+6pIK0Du9y4ItHPH Lg== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com with ESMTP id 2uv212ekj9-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:49:39 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 0B28B23 for ; Mon, 9 Sep 2019 15:49:36 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 6C5AE2B25FB for ; Mon, 9 Sep 2019 17:49:35 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:49:35 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 12/24] [ARM] FDPIC: Restore r9 after we call __aeabi_read_tp Date: Mon, 9 Sep 2019 17:44:54 +0200 Message-ID: <20190909154526.11630-13-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon We call __aeabi_read_tp() to get the thread pointer. Since this is a function call, we have to restore the FDPIC register afterwards. 2019-XX-XX Christophe Lyon Mickaël Guêné gcc/ * config/arm/arm.c (arm_load_tp): Add FDPIC support. * config/arm/arm.md (FDPIC_REGNUM): New constant. (load_tp_soft_fdpic): New pattern. (load_tp_soft): Disable in FDPIC mode. Change-Id: I0811cc7c5df8f44dd8b8b1f4caf54c7d3609c414 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 5f1d2d4..c452771 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -8685,7 +8685,18 @@ arm_load_tp (rtx target) rtx tmp; - emit_insn (gen_load_tp_soft ()); + if (TARGET_FDPIC) + { + rtx fdpic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + rtx initial_fdpic_reg = get_hard_reg_initial_val (Pmode, FDPIC_REGNUM); + + emit_insn (gen_load_tp_soft_fdpic ()); + + /* Restore r9. */ + emit_insn (gen_restore_pic_register_after_call(fdpic_reg, initial_fdpic_reg)); + } + else + emit_insn (gen_load_tp_soft ()); tmp = gen_rtx_REG (SImode, R0_REGNUM); emit_move_insn (target, tmp); diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index 027febb..918271d 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -31,6 +31,7 @@ [(R0_REGNUM 0) ; First CORE register (R1_REGNUM 1) ; Second CORE register (R4_REGNUM 4) ; Fifth CORE register + (FDPIC_REGNUM 9) ; FDPIC register (IP_REGNUM 12) ; Scratch register (SP_REGNUM 13) ; Stack pointer (LR_REGNUM 14) ; Return address register @@ -11165,12 +11166,25 @@ ) ;; Doesn't clobber R1-R3. Must use r0 for the first operand. +(define_insn "load_tp_soft_fdpic" + [(set (reg:SI 0) (unspec:SI [(const_int 0)] UNSPEC_TLS)) + (clobber (reg:SI FDPIC_REGNUM)) + (clobber (reg:SI LR_REGNUM)) + (clobber (reg:SI IP_REGNUM)) + (clobber (reg:CC CC_REGNUM))] + "TARGET_SOFT_TP && TARGET_FDPIC" + "bl\\t__aeabi_read_tp\\t@ load_tp_soft" + [(set_attr "conds" "clob") + (set_attr "type" "branch")] +) + +;; Doesn't clobber R1-R3. Must use r0 for the first operand. (define_insn "load_tp_soft" [(set (reg:SI 0) (unspec:SI [(const_int 0)] UNSPEC_TLS)) (clobber (reg:SI LR_REGNUM)) (clobber (reg:SI IP_REGNUM)) (clobber (reg:CC CC_REGNUM))] - "TARGET_SOFT_TP" + "TARGET_SOFT_TP && !TARGET_FDPIC" "bl\\t__aeabi_read_tp\\t@ load_tp_soft" [(set_attr "conds" "clob") (set_attr "type" "branch")] From patchwork Mon Sep 9 15:44:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 1159816 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-508655-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="ky6E6VOB"; dkim=pass (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="1Q0Mr5a/"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46Rt0L75dCz9s00 for ; Tue, 10 Sep 2019 01:50:10 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=o3J eibScJwcRkBj8DIXAphHsTvKvKgPStNWmQwDLqPhH8mVdMMcjYPG/0zfjKF46c+h ehqBAr1CWGtYWYca62bdkq9w/Trty2pI8J1wT8kE9Rk0GtppoeTXWGBqpwt2CNd7 TNp7dh/OqFCEP1Y2vgIGY1OCPQZaiUiCXGgSfT+c= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=dXIgCF8Jw yRGzkTKFQ5RWMUX0ck=; b=ky6E6VOBraMOx2mSkhxlteGzQYI9NLVV2w1kRbXJO 490yelHS7Lkk3RAYCH5CQDndF8awhTP/gNNKopwQDvnTwYpUi6DsvvSbF3pm7mM8 19lY5qkseEfO8kzB+uuFB++UXthdPbQ0ZcDNtw10dv1+qeBAZKQ6vcVKJSoreAn3 6Q= Received: (qmail 128886 invoked by alias); 9 Sep 2019 15:50:04 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 128878 invoked by uid 89); 9 Sep 2019 15:50:04 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:50:03 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FkORN001286 for ; Mon, 9 Sep 2019 17:50:01 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=1aQ9HGDT+5uBJnceRF5Eaa0gSSJ4x1oK08RWqcj5YXE=; b=1Q0Mr5a/mD9dSUNo/heQgKH6RysztXDbjpLZvmNkgGBHpwPqfu+lN9+NnOrWtPvm+9XX D82wfkUnZ+kV3pNG5y68RYVQIXlc4P1MbmlWtPR/sSsPEz9LonHUz00I0a8Lt93DPaLW yWMUN4MLl/yMxe3GMhSrxLnF8JmhU5tPqiP1Ps4U3nirmdX2xjtqJgG3iEvWdPHNbWg5 MHVl5BcUkgJBbW9++PFzCQCpyueJQovAe6ov6cvWzT+tkAigSZkSNMPs/qn/l/cl/fI9 60GwlxgaGZbFtJRZSSrtvDnIDb9evVB1OuuGLngjH34IsutmkPqzlnbmtrI/gKueJ0qf Ww== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com with ESMTP id 2uv212ekn9-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:50:01 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 397F24B for ; Mon, 9 Sep 2019 15:49:56 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 9941A2B9BFC for ; Mon, 9 Sep 2019 17:49:55 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:49:55 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 13/24] [ARM] FDPIC: Force LSB bit for PC in Cortex-M architecture Date: Mon, 9 Sep 2019 17:44:55 +0200 Message-ID: <20190909154526.11630-14-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon Without this, when we are unwinding across a signal frame we can jump to an even address which leads to an exception. This is needed in __gnu_persnality_sigframe_fdpic() when restoring the PC from the signal frame since the PC saved by the kernel has the LSB bit set to zero. 2019-XX-XX Christophe Lyon Mickaël Guêné libgcc/ * config/arm/unwind-arm.c (_Unwind_VRS_Set): Handle thumb-only architecture. Change-Id: Ie84de548226bcf1751e19a09e8f091fb3013ccea diff --git a/libgcc/config/arm/unwind-arm.c b/libgcc/config/arm/unwind-arm.c index 9ba73e7..8313ee0 100644 --- a/libgcc/config/arm/unwind-arm.c +++ b/libgcc/config/arm/unwind-arm.c @@ -199,6 +199,11 @@ _Unwind_VRS_Result _Unwind_VRS_Set (_Unwind_Context *context, return _UVRSR_FAILED; vrs->core.r[regno] = *(_uw *) valuep; +#if defined(__thumb__) + /* Force LSB bit since we always run thumb code. */ + if (regno == R_PC) + vrs->core.r[regno] |= 1; +#endif return _UVRSR_OK; case _UVRSC_VFP: From patchwork Mon Sep 9 15:44:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 1159817 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-508656-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="e5GCUPIL"; dkim=pass (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="j7kGJeIt"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46Rt0m6LPPz9s00 for ; Tue, 10 Sep 2019 01:50:32 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=J0M HmgojMSz5/Mww84DGRT46ehwuMNJ1hP3sRPlJX4rokbhVYL/DlAJwqJRSN7fDi93 6yf7yhssfdVjOhQtGs8OR/M/2bleLz0rONfTOT7DPP7eeMwUYku0Iaqmawzk4ixT q9FXuWpL6q4kygaYb7se/c5l/bmDmR/rohmdBzk8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=5WqTsisyT lRuMm0Y5YKg/mLKuHo=; b=e5GCUPILX+eR2+7LftUo1J5ioGTRUlHYBq32j+jBS LCDsZb7uh63xuIj/fBq7R2K7Je0ypSztC8Ex9OGxJMWxad0kiwlRhLUwDE3rZyel ZjbcogLYG4G0lB4CeldoMkMtGVUDDsImS6wc7o8Gt96DDpDYBQGKo1iWQEzU0TmP gI= Received: (qmail 684 invoked by alias); 9 Sep 2019 15:50:25 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 675 invoked by uid 89); 9 Sep 2019 15:50:24 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:50:22 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FkKNW001257 for ; Mon, 9 Sep 2019 17:50:19 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=7GwpjKxZv00igImv92Kgj+zStkhT3TdjMEvURQD16pc=; b=j7kGJeItZ5lXUs++r8GjVOFHaf5j5hsDW1Z5hb7fsp/qCUCKsiUsvrLxWrM/xHY5jq5g dzqdyTxMGu5XNe03gY75ngZw3pMQnMFT4zMLOGKC+NToe9jx5BVZr5VYnVbAk2hBX7X0 MC1uIPqP9L4EMM5RbDCCACSPowu5ENWvERld+/h8/ldo32C1DlY8yosnVOXKlKCsuCb8 DAA1KSC54VOVFkuczeMc9+ED116PWjTKTj4Sqs65/5EI59ARUnkjUE+sQtAFhM650rmq vBTBjg7D/HGnGIe4+aGW65p96k8E9lw/jIE2jfqTp1Pa0jD4p9IKVrFxntJFkNcv26rw 2w== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com with ESMTP id 2uv212ekps-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:50:19 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 2209F22 for ; Mon, 9 Sep 2019 15:50:16 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id D66B92B5A07 for ; Mon, 9 Sep 2019 17:50:15 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:50:15 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 14/24] [ARM][testsuite] FDPIC: Skip unsupported tests Date: Mon, 9 Sep 2019 17:44:56 +0200 Message-ID: <20190909154526.11630-15-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon Several tests cannot work on ARM-FDPIC for various reasons: skip them, or skip some directives. gcc.dg/20020312-2.c: Skip since it forces -fno-pic. gcc.target/arm/: * Skip since r9 is clobbered by assembly code: 20051215-1.c mmx-1.c pr61948.c pr77933-1.c pr77933-2.c * Skip since the test forces armv5te which is not supported by FDPIC: pr40887.c pr19599.c * Skip since FDPIC disables sibcall to external functions: sibcall-1.c tail-long-call vfp-longcall-apcs * Skip size check since it's different for FDPIC: ivopts-2.c ivopts-3.c ivopts-4.c ivopts-5.c pr43597.c pr43920-2.c * Disable assembler scanning invalid for FDPIC: pr45701-1.c pr45701-2.c stack-red-zone.c * gnu2 TLS dialect is not supported by FDPIC: tlscall.c * Test relies on symbols not generated in FDPIC: data-rel-2.c data-rel-3.c 2019-XX-XX Christophe Lyon Mickaël Guêné gcc/testsuite/ * gcc.dg/20020312-2.c: Skip on arm*-*-uclinuxfdpiceabi. * gcc.target/arm/20051215-1.c: Likewise. * gcc.target/arm/mmx-1.c: Likewise. * gcc.target/arm/pr19599.c: Likewise. * gcc.target/arm/pr40887.c: Likewise. * gcc.target/arm/pr61948.c: Likewise. * gcc.target/arm/pr77933-1.c: Likewise. * gcc.target/arm/pr77933-2.c: Likewise. * gcc.target/arm/sibcall-1.c: Likewise. * gcc.target/arm/data-rel-2.c: Likewise. * gcc.target/arm/data-rel-3.c: Likewise. * gcc.target/arm/tail-long-call: Likewise. * gcc.target/arm/tlscall.c: Likewise. * gcc.target/arm/vfp-longcall-apcs: Likewise. * gcc.target/arm/ivopts-2.c: Skip object-size test on arm*-*-uclinuxfdpiceabi. * gcc.target/arm/ivopts-3.c: Likewise. * gcc.target/arm/ivopts-4.c: Likewise. * gcc.target/arm/ivopts-5.c: Likewise. * gcc.target/arm/pr43597.c: Likewise. * gcc.target/arm/pr43920-2.c: Likewise. * gcc.target/arm/pr45701-1.c: Skip scan-assembler on arm*-*-uclinuxfdpiceabi. * gcc.target/arm/pr45701-2.c: Likewise. * gcc.target/arm/stack-red-zone.c: Likewise. Change-Id: Icada7ce52537901fdac10403e7997571b7e2c509 diff --git a/gcc/testsuite/gcc.dg/20020312-2.c b/gcc/testsuite/gcc.dg/20020312-2.c index 98af0d4..52c33d0 100644 --- a/gcc/testsuite/gcc.dg/20020312-2.c +++ b/gcc/testsuite/gcc.dg/20020312-2.c @@ -9,6 +9,7 @@ /* { dg-options "-O -fno-pic" } */ /* { dg-additional-options "-no-pie" { target pie_enabled } } */ /* { dg-require-effective-target nonlocal_goto } */ +/* { dg-skip-if "" { arm*-*-uclinuxfdpiceabi } "*" "" } */ extern void abort (void); diff --git a/gcc/testsuite/gcc.target/arm/20051215-1.c b/gcc/testsuite/gcc.target/arm/20051215-1.c index 0519dc7..cc07693 100644 --- a/gcc/testsuite/gcc.target/arm/20051215-1.c +++ b/gcc/testsuite/gcc.target/arm/20051215-1.c @@ -3,6 +3,7 @@ the call would need an output reload. */ /* { dg-do run } */ /* { dg-options "-O2 -fno-omit-frame-pointer" } */ +/* { dg-skip-if "r9 is reserved in FDPIC" { arm*-*-uclinuxfdpiceabi } "*" "" } */ extern void abort (void); typedef void (*callback) (void); diff --git a/gcc/testsuite/gcc.target/arm/data-rel-2.c b/gcc/testsuite/gcc.target/arm/data-rel-2.c index 6ba47d6..7d37a8c 100644 --- a/gcc/testsuite/gcc.target/arm/data-rel-2.c +++ b/gcc/testsuite/gcc.target/arm/data-rel-2.c @@ -1,3 +1,4 @@ +/* { dg-skip-if "Not supported in FDPIC" { arm*-*-uclinuxfdpiceabi } "*" "" } */ /* { dg-options "-fPIC -mno-pic-data-is-text-relative -mno-single-pic-base" } */ /* { dg-final { scan-assembler-not "j-\\(.LPIC" } } */ /* { dg-final { scan-assembler "_GLOBAL_OFFSET_TABLE_-\\(.LPIC" } } */ diff --git a/gcc/testsuite/gcc.target/arm/data-rel-3.c b/gcc/testsuite/gcc.target/arm/data-rel-3.c index 2ce1e66..534c6c4 100644 --- a/gcc/testsuite/gcc.target/arm/data-rel-3.c +++ b/gcc/testsuite/gcc.target/arm/data-rel-3.c @@ -1,3 +1,4 @@ +/* { dg-skip-if "Not supported in FDPIC" { arm*-*-uclinuxfdpiceabi } "*" "" } */ /* { dg-options "-fPIC -mpic-data-is-text-relative" } */ /* { dg-final { scan-assembler "j-\\(.LPIC" } } */ /* { dg-final { scan-assembler-not "_GLOBAL_OFFSET_TABLE_-\\(.LPIC" } } */ diff --git a/gcc/testsuite/gcc.target/arm/ivopts-2.c b/gcc/testsuite/gcc.target/arm/ivopts-2.c index afe91aa..f1d5edb 100644 --- a/gcc/testsuite/gcc.target/arm/ivopts-2.c +++ b/gcc/testsuite/gcc.target/arm/ivopts-2.c @@ -14,4 +14,4 @@ tr4 (short array[], int n) /* { dg-final { scan-tree-dump-times "PHI X-Patchwork-Id: 1159818 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-508657-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="kgTI0EVF"; dkim=pass (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="kVbcjKkj"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46Rt186WzHz9s00 for ; Tue, 10 Sep 2019 01:50:51 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=NuY q+T62MXys3ha3+3wKw8S4D3CLTR2ijXk32jBmG8XFLFxkdzaRUSMQC6CqRYOyRjp Oc7CR3o9Yxz7wfqrGgOl1oxgRPvAdj/w0BH9wWBvChZ37BiJHp5leO/CLp+VSzHZ DTu4U6Zd4HCHtq3qSIPk1xxrHtS/rGuD0q9KH/+I= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=qyjGN3l8E 5S084osY6+jDCYKysc=; b=kgTI0EVFpvckHjU/CncAX+qDREAJRzp/2eXGyuw3V 3LJLyp49Vq2NDFfTVj5Pg/q18Pi8UOuMxcNXdcrEI/CjewxJHqP1lGmlvVeypL12 /JOPoN4iicUY+ZFNd4lG1YTTda1FUhOw7qA2TLWR+Odxzku5q/yQ28us8tgbvJDy +o= Received: (qmail 2491 invoked by alias); 9 Sep 2019 15:50:44 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 2480 invoked by uid 89); 9 Sep 2019 15:50:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx07-00178001.pphosted.com Received: from mx08-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (91.207.212.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:50:42 +0000 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FkAiF003533 for ; Mon, 9 Sep 2019 17:50:40 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=V+G6YBtvE+TCG0l4zg0mkxbBJ7/PhsVpV/C8lhJJxmM=; b=kVbcjKkjuiSvLqCd4Fq5IRetS5l0FKdBOkhWkbT6T1RTJtnVUOMLwUQ13BTqkMWkoYSy Oj2ItACQKrWDB1xPQuFjrCYs/DQj+Cc2fwjzsMui1fmnIAED0dJ4se+nla3QZXLRK9LS lHsYFSJq2zds3kTGeZQPwmiRq8RPcgSbPv4JUNptoyNNPTbgimcibANsW5HKFcY67mrs h8VK/EhQcrlFcEsznRr++msyLxIzSfCqJxYHUumUwz03foV/BV/PaZsUXqT/M6fK6Y7F 9VtOCzFByxX8Or96oUj2fqZSWTOG7Pe2zvLGUWgX6yr9ZEuM95kzgP/U3D9NrTiX9vpy PA== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx08-00178001.pphosted.com with ESMTP id 2uv1pa7144-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:50:40 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 0E5A623 for ; Mon, 9 Sep 2019 15:50:36 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 129CF2ADEEE for ; Mon, 9 Sep 2019 17:50:36 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:50:35 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 15/24] [ARM][testsuite] FDPIC: Adjust scan-assembler patterns. Date: Mon, 9 Sep 2019 17:44:57 +0200 Message-ID: <20190909154526.11630-16-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon In FDPIC mode, r9 is saved in addition to other registers, so update the expected patterns accordingly. 2019-XX-XX Christophe Lyon Mickaël Guêné * gcc/testsuite/ * gcc.target/arm/interrupt-1.c: Add scan-assembler pattern for arm*-*-uclinuxfdpiceabi. * gcc.target/arm/interrupt-2.c: Likewise. * gcc.target/arm/pr70830.c: Likewise. Change-Id: Id946b79bacc32be585c31e60a355191f104cc29e diff --git a/gcc/testsuite/gcc.target/arm/interrupt-1.c b/gcc/testsuite/gcc.target/arm/interrupt-1.c index fe94877..493763d 100644 --- a/gcc/testsuite/gcc.target/arm/interrupt-1.c +++ b/gcc/testsuite/gcc.target/arm/interrupt-1.c @@ -13,5 +13,7 @@ void foo () bar (0); } -/* { dg-final { scan-assembler "push\t{r0, r1, r2, r3, r4, fp, ip, lr}" } } */ -/* { dg-final { scan-assembler "ldmfd\tsp!, {r0, r1, r2, r3, r4, fp, ip, pc}\\^" } } */ +/* { dg-final { scan-assembler "push\t{r0, r1, r2, r3, r4, fp, ip, lr}" { target { ! arm*-*-uclinuxfdpiceabi } } } } */ +/* { dg-final { scan-assembler "ldmfd\tsp!, {r0, r1, r2, r3, r4, fp, ip, pc}\\^" { target { ! arm*-*-uclinuxfdpiceabi } } } } */ +/* { dg-final { scan-assembler "push\t{r0, r1, r2, r3, r4, r5, r9, fp, ip, lr}" { target arm*-*-uclinuxfdpiceabi } } } */ +/* { dg-final { scan-assembler "ldmfd\tsp!, {r0, r1, r2, r3, r4, r5, r9, fp, ip, pc}\\^" { target arm*-*-uclinuxfdpiceabi } } } */ diff --git a/gcc/testsuite/gcc.target/arm/interrupt-2.c b/gcc/testsuite/gcc.target/arm/interrupt-2.c index 289eca0..5be1f16 100644 --- a/gcc/testsuite/gcc.target/arm/interrupt-2.c +++ b/gcc/testsuite/gcc.target/arm/interrupt-2.c @@ -15,5 +15,7 @@ void test() foo = 0; } -/* { dg-final { scan-assembler "push\t{r0, r1, r2, r3, r4, r5, ip, lr}" } } */ -/* { dg-final { scan-assembler "ldmfd\tsp!, {r0, r1, r2, r3, r4, r5, ip, pc}\\^" } } */ +/* { dg-final { scan-assembler "push\t{r0, r1, r2, r3, r4, r5, ip, lr}" { target { ! arm*-*-uclinuxfdpiceabi } } } } */ +/* { dg-final { scan-assembler "ldmfd\tsp!, {r0, r1, r2, r3, r4, r5, ip, pc}\\^" { target { ! arm*-*-uclinuxfdpiceabi } } } } */ +/* { dg-final { scan-assembler "push\t{r0, r1, r2, r3, r4, r5, r6, r9, ip, lr}" { target arm*-*-uclinuxfdpiceabi } } } */ +/* { dg-final { scan-assembler "ldmfd\tsp!, {r0, r1, r2, r3, r4, r5, r6, r9, ip, pc}\\^" { target arm*-*-uclinuxfdpiceabi } } } */ diff --git a/gcc/testsuite/gcc.target/arm/pr70830.c b/gcc/testsuite/gcc.target/arm/pr70830.c index cad903b..cd84c42 100644 --- a/gcc/testsuite/gcc.target/arm/pr70830.c +++ b/gcc/testsuite/gcc.target/arm/pr70830.c @@ -11,4 +11,5 @@ void __attribute__ ((interrupt ("IRQ"))) dm3730_IRQHandler(void) { prints("IRQ" ); } -/* { dg-final { scan-assembler "ldmfd\tsp!, {r0, r1, r2, r3, ip, pc}\\^" } } */ +/* { dg-final { scan-assembler "ldmfd\tsp!, {r0, r1, r2, r3, ip, pc}\\^" { target { ! arm*-*-uclinuxfdpiceabi } } } } */ +/* { dg-final { scan-assembler "ldmfd\tsp!, {r0, r1, r2, r3, r4, r9, ip, pc}\\^" { target arm*-*-uclinuxfdpiceabi } } } */ From patchwork Mon Sep 9 15:44:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 1159819 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-508658-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="xy+SRh2L"; dkim=pass (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="xqy2Ag6r"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46Rt1V6j1bz9s7T for ; Tue, 10 Sep 2019 01:51:10 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; q=dns; s=default; b=PAW7ig0DLNOSdwilwPmilLzMofzsQ paopoIFkykC29HdZdw2ghYsAvrPZqU21zZB4DB4oIE09a9BPhGQHoc+KcyKq6gtI WD7Ydlp2DJoIhSPiQUXOy5F61JXVsiNOLCYlBVb6aWEZC+BgJ/tUPfQKt1gGHi9r nysyl0mneX/ADc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; s=default; bh=WgkWMKvAux4f2O9HtffyjobDoXs=; b=xy+ SRh2LxfZrgt/IoEf75uexrdNTmdq7xRZkTueIlMxIXWtmFw0i2my+nK70z3rW3F+ itp6ipB9pOUmDuDQxrpUmA4wsQvFMsEODy0bJJ6tiSYYP5WRdv/EX7qs8pFEIAW1 2MlUv7rMZXcr7ITDWSTYgZexM9wuJhWJODc1tu/E= Received: (qmail 4054 invoked by alias); 9 Sep 2019 15:51:04 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 4045 invoked by uid 89); 9 Sep 2019 15:51:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=*-*-darwin*, **darwin*, gdwarf2, gdwarf-2 X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:51:02 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FkMPt001274 for ; Mon, 9 Sep 2019 17:50:59 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=4hWG6cwfwKnhzInk8p4B7njAiaMGipAcBR172XOEFgM=; b=xqy2Ag6r6Rnr7gM+cd4OAy0Em1B1ZYso+XrDX3CDgx5TrKj9g6Vs+LoqKKI58qwff0lx vTqv3FbiWuSJYYBwE9s0jIQHMiUt0jaUmfAZVfmQCdDp0b+l+nmePzpcrSSColP0df90 2eaDNtw3hyPDz7u1XKj7liVY5AabBtD647XHxq2MZfrbHPNknG2v/J54PnlBD1cj7q0Y RnHmXlJ+VhxEWuHRlOH/z95w6fWHov2CQYUmFFxWvZinx2NOt4yW3AYP8YujN8nBpGcF /hRbs92vFycKZ0PsNmJA36b11YvYfg3DUIs+2jiHmwu+ZFuliuSURKU/MsM4JyK/bh/c CQ== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com with ESMTP id 2uv212eksu-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:50:59 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id DEC644B for ; Mon, 9 Sep 2019 15:50:56 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 4B6C52ADEEE for ; Mon, 9 Sep 2019 17:50:56 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:50:55 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 16/24] [ARM][testsuite] FDPIC: Skip tests that don't work in PIC mode Date: Mon, 9 Sep 2019 17:44:58 +0200 Message-ID: <20190909154526.11630-17-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon Some tests fail on arm*-*-uclinuxfdpiceabi because it generates PIC code and they don't support it: skip them. They also fail on arm*-linux* when forcing -fPIC. 2019-XX-XX Christophe Lyon gcc/testsuite/ * gcc.target/arm/eliminate.c: Accept only nonpic targets. * g++.dg/other/anon5.C: Likewise. Change-Id: I8efb8d356ce25b020c44a84b07f79a996dca0358 diff --git a/gcc/testsuite/g++.dg/other/anon5.C b/gcc/testsuite/g++.dg/other/anon5.C index ee4601e..dadd92e 100644 --- a/gcc/testsuite/g++.dg/other/anon5.C +++ b/gcc/testsuite/g++.dg/other/anon5.C @@ -1,5 +1,6 @@ // PR c++/34094 // { dg-do link { target { ! { *-*-darwin* *-*-hpux* *-*-solaris2.* } } } } +// { dg-require-effective-target nonpic } // { dg-options "-gdwarf-2" } // Ignore additional message on powerpc-ibm-aix // { dg-prune-output "obtain more information" } */ diff --git a/gcc/testsuite/gcc.target/arm/eliminate.c b/gcc/testsuite/gcc.target/arm/eliminate.c index f254dd8..299d4df 100644 --- a/gcc/testsuite/gcc.target/arm/eliminate.c +++ b/gcc/testsuite/gcc.target/arm/eliminate.c @@ -1,4 +1,4 @@ -/* { dg-do compile } */ +/* { dg-do compile { target { nonpic } } } */ /* { dg-options "-O2" } */ struct X From patchwork Mon Sep 9 15:44:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 1159821 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-508659-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="u2JbrCaL"; dkim=pass (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="QK5PNUZ4"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46Rt1y1n1qz9s00 for ; Tue, 10 Sep 2019 01:51:34 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; q=dns; s=default; b=P0f8p3MeVrIgBiEif840HuKfj0DvB NanIJrzPr4gBlNH/YuAX17oCFkbA8KZTXxM4gNfEZyCZzo2woPDOEMYzoidWlMVj EF6QqdIQdWfatojj88lZX6pSyUNXTHfgUx0ZvfbpNum3xabYogfPKAM6ZrTICZDO X7p88EzMzI4bog= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; s=default; bh=gr7aLgVGbg4RYSefRZquc4RBu6o=; b=u2J brCaLEhQvwI08RAZoTV0EAHEgX489mivOFWpDLuI1ythVtAqqxsUN592ZkDVvmn9 E4J+cdx1A1r+zEEBTOONgbi/iVtyfA+7jdNAZKIe/DNjgPUCcAi/a+mKSZGBTJ6G bDa1bP53/WB1Rww6KHr+qycy43dt/9GsHUDsI4CM= Received: (qmail 5589 invoked by alias); 9 Sep 2019 15:51:26 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 5581 invoked by uid 89); 9 Sep 2019 15:51:26 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=Origin X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:51:22 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FpDJd005011 for ; Mon, 9 Sep 2019 17:51:20 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=dRpwbPrzXRMJoeGKJjDI2r+VJdkFHBiijHklafju9fQ=; b=QK5PNUZ4oNuXHDwi2tdZupPrL6ygSgDONdgApUI3LuXESK5KrF0QDb3SzjTuQUT6Hc29 GRtJTvW0717U6D6sQIsdka4IXXG1m9CpxM4h7VG6nxh8ogNiCn9wDv3rFqC1t34rwUkS E6oJo51BDqLy1PjFICuy4uDDWRVxOMd9VsmgVayVR0L2CueO+N0oMqHzlvy4+CuHTnK3 NKsD3SUyU5MaeuMeBM85WpE/qKfixYDTo+tklIqJxdiLaDI3jNysIsuXP4l4bRObqCnN CcNjDNJp/qfn1pi3RfqqtyWhqF6Z67Hf66Ih870Yp9B2yOuJM3DWZHcIdAwdYrmZtc60 IQ== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com with ESMTP id 2uv212ekup-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:51:20 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 2D9944C for ; Mon, 9 Sep 2019 15:51:17 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 8D0672B0E11 for ; Mon, 9 Sep 2019 17:51:16 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:51:16 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 17/24] [ARM][testsuite] FDPIC: Handle *-*-uclinux* Date: Mon, 9 Sep 2019 17:44:59 +0200 Message-ID: <20190909154526.11630-18-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon Add *-*-uclinux* to tests that work on this target. 2019-XX-XX Christophe Lyon gcc/testsuite/ * g++.dg/abi/forced.C: Add *-*-uclinux*. * g++.dg/abi/guard2.C: Likewise. * g++.dg/ext/cleanup-10.C: Likewise. * g++.dg/ext/cleanup-11.C: Likewise. * g++.dg/ext/cleanup-8.C: Likewise. * g++.dg/ext/cleanup-9.C: Likewise. * g++.dg/ext/sync-4.C: Likewise. * g++.dg/ipa/comdat.C: Likewise. * gcc.dg/20041106-1.c: Likewise. * gcc.dg/cleanup-10.c: Likewise. * gcc.dg/cleanup-11.c: Likewise. * gcc.dg/cleanup-8.c: Likewise. * gcc.dg/cleanup-9.c: Likewise. * gcc.dg/fdata-sections-1.c: Likewise. * gcc.dg/fdata-sections-2.c: Likewise. * gcc.dg/pr39323-1.c: Likewise. * gcc.dg/pr39323-2.c: Likewise. * gcc.dg/pr39323-3.c: Likewise. * gcc.dg/pr65780-1.c: Likewise. * gcc.dg/pr65780-2.c: Likewise. * gcc.dg/pr67338.c: Likewise. * gcc.dg/pr78185.c: Likewise. * gcc.dg/pr83100-1.c: Likewise. * gcc.dg/pr83100-4.c: Likewise. * gcc.dg/strlenopt-12g.c: Likewise. * gcc.dg/strlenopt-14g.c: Likewise. * gcc.dg/strlenopt-14gf.c: Likewise. * gcc.dg/strlenopt-16g.c: Likewise. * gcc.dg/strlenopt-17g.c: Likewise. * gcc.dg/strlenopt-18g.c: Likewise. * gcc.dg/strlenopt-1f.c: Likewise. * gcc.dg/strlenopt-22g.c: Likewise. * gcc.dg/strlenopt-2f.c: Likewise. * gcc.dg/strlenopt-31g.c: Likewise. * gcc.dg/strlenopt-33g.c: Likewise. * gcc.dg/strlenopt-4g.c: Likewise. * gcc.dg/strlenopt-4gf.c: Likewise. * gcc.dg/strncmp-2.c: Likewise. * gcc.dg/struct-ret-3.c: Likewise. * gcc.dg/torture/pr69760.c: Likewise. * gcc.target/arm/div64-unwinding.c: Likewise. * gcc.target/arm/stack-checking.c: Likewise. * gcc.target/arm/synchronize.c: Likewise. * gcc.target/arm/pr66912.c: Add arm*-*-uclinuxfdpiceabi. * lib/target-supports.exp (check_effective_target_pie): Likewise. (check_effective_target_sync_long_long_runtime): Likewise. (check_effective_target_sync_int_long): Likewise. (check_effective_target_sync_char_short): Likewise. Change-Id: I89bfea79d4490c5df0b6470def5a31d7f31ac2cc diff --git a/gcc/testsuite/g++.dg/abi/forced.C b/gcc/testsuite/g++.dg/abi/forced.C index 0e6be28..2d1ec53 100644 --- a/gcc/testsuite/g++.dg/abi/forced.C +++ b/gcc/testsuite/g++.dg/abi/forced.C @@ -1,4 +1,4 @@ -// { dg-do run { target *-*-linux* *-*-gnu* } } +// { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } // { dg-options "-pthread" } #include diff --git a/gcc/testsuite/g++.dg/abi/guard2.C b/gcc/testsuite/g++.dg/abi/guard2.C index c35fa7e..74139a8 100644 --- a/gcc/testsuite/g++.dg/abi/guard2.C +++ b/gcc/testsuite/g++.dg/abi/guard2.C @@ -1,6 +1,6 @@ // PR c++/41611 // Test that the guard gets its own COMDAT group. -// { dg-final { scan-assembler "_ZGVZN1A1fEvE1i,comdat" { target *-*-linux* *-*-gnu* } } } +// { dg-final { scan-assembler "_ZGVZN1A1fEvE1i,comdat" { target *-*-linux* *-*-gnu* *-*-uclinux* } } } struct A { static int f() diff --git a/gcc/testsuite/g++.dg/ext/cleanup-10.C b/gcc/testsuite/g++.dg/ext/cleanup-10.C index 66c7b76..56aeb66 100644 --- a/gcc/testsuite/g++.dg/ext/cleanup-10.C +++ b/gcc/testsuite/g++.dg/ext/cleanup-10.C @@ -1,4 +1,4 @@ -/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */ +/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* *-*-uclinux* } } */ /* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */ /* Verify that cleanups work with exception handling through signal frames on alternate stack. */ diff --git a/gcc/testsuite/g++.dg/ext/cleanup-11.C b/gcc/testsuite/g++.dg/ext/cleanup-11.C index 6e96521..c6d3560 100644 --- a/gcc/testsuite/g++.dg/ext/cleanup-11.C +++ b/gcc/testsuite/g++.dg/ext/cleanup-11.C @@ -1,4 +1,4 @@ -/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */ +/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* *-*-uclinux* } } */ /* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */ /* Verify that cleanups work with exception handling through realtime signal frames on alternate stack. */ diff --git a/gcc/testsuite/g++.dg/ext/cleanup-8.C b/gcc/testsuite/g++.dg/ext/cleanup-8.C index ccf9bef..e99508d 100644 --- a/gcc/testsuite/g++.dg/ext/cleanup-8.C +++ b/gcc/testsuite/g++.dg/ext/cleanup-8.C @@ -1,4 +1,4 @@ -/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */ +/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* *-*-uclinux* } } */ /* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */ /* Verify that cleanups work with exception handling through signal frames. */ diff --git a/gcc/testsuite/g++.dg/ext/cleanup-9.C b/gcc/testsuite/g++.dg/ext/cleanup-9.C index dcdfcae..45e5f90 100644 --- a/gcc/testsuite/g++.dg/ext/cleanup-9.C +++ b/gcc/testsuite/g++.dg/ext/cleanup-9.C @@ -1,4 +1,4 @@ -/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */ +/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* *-*-uclinux* } } */ /* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */ /* Verify that cleanups work with exception handling through realtime signal frames. */ diff --git a/gcc/testsuite/g++.dg/ext/sync-4.C b/gcc/testsuite/g++.dg/ext/sync-4.C index 8a2de48..029afb0 100644 --- a/gcc/testsuite/g++.dg/ext/sync-4.C +++ b/gcc/testsuite/g++.dg/ext/sync-4.C @@ -1,4 +1,4 @@ -/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */ +/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* *-*-uclinux* } } */ /* FIXME The following additional option should be removed after the fix for radr://19802258. /* { dg-xfail-run-if "PR60563 radr://19802258" { *-*-darwin* } } */ /* { dg-require-effective-target sync_long_long_runtime } */ diff --git a/gcc/testsuite/g++.dg/ipa/comdat.C b/gcc/testsuite/g++.dg/ipa/comdat.C index 1945e32..f3df99a 100644 --- a/gcc/testsuite/g++.dg/ipa/comdat.C +++ b/gcc/testsuite/g++.dg/ipa/comdat.C @@ -1,4 +1,4 @@ -/* { dg-do compile { target *-*-linux* *-*-gnu* } } */ +/* { dg-do compile { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-ipa-comdats" } */ #include __attribute__ ((noinline)) diff --git a/gcc/testsuite/gcc.dg/20041106-1.c b/gcc/testsuite/gcc.dg/20041106-1.c index cba4a06..95579ff 100644 --- a/gcc/testsuite/gcc.dg/20041106-1.c +++ b/gcc/testsuite/gcc.dg/20041106-1.c @@ -1,4 +1,4 @@ -/* { dg-do run { target *-*-linux* *-*-gnu* *-*-solaris* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-solaris* *-*-uclinux* } } */ /* { dg-options -O2 } */ #include diff --git a/gcc/testsuite/gcc.dg/cleanup-10.c b/gcc/testsuite/gcc.dg/cleanup-10.c index 1af63ea..9fc8658 100644 --- a/gcc/testsuite/gcc.dg/cleanup-10.c +++ b/gcc/testsuite/gcc.dg/cleanup-10.c @@ -1,4 +1,4 @@ -/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */ +/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* *-*-uclinux* } } */ /* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */ /* { dg-require-effective-target exceptions } */ /* Verify that cleanups work with exception handling through signal frames diff --git a/gcc/testsuite/gcc.dg/cleanup-11.c b/gcc/testsuite/gcc.dg/cleanup-11.c index c1f19fe..6b499d4 100644 --- a/gcc/testsuite/gcc.dg/cleanup-11.c +++ b/gcc/testsuite/gcc.dg/cleanup-11.c @@ -1,4 +1,4 @@ -/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */ +/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* *-*-uclinux* } } */ /* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */ /* { dg-require-effective-target exceptions } */ /* Verify that cleanups work with exception handling through realtime signal diff --git a/gcc/testsuite/gcc.dg/cleanup-8.c b/gcc/testsuite/gcc.dg/cleanup-8.c index 45abdb2..87f4186 100644 --- a/gcc/testsuite/gcc.dg/cleanup-8.c +++ b/gcc/testsuite/gcc.dg/cleanup-8.c @@ -1,4 +1,4 @@ -/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */ +/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* *-*-uclinux* } } */ /* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */ /* { dg-require-effective-target exceptions } */ /* Verify that cleanups work with exception handling through signal diff --git a/gcc/testsuite/gcc.dg/cleanup-9.c b/gcc/testsuite/gcc.dg/cleanup-9.c index 98dc268..d34ce12 100644 --- a/gcc/testsuite/gcc.dg/cleanup-9.c +++ b/gcc/testsuite/gcc.dg/cleanup-9.c @@ -1,4 +1,4 @@ -/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */ +/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* *-*-uclinux* } } */ /* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */ /* { dg-require-effective-target exceptions } */ /* Verify that cleanups work with exception handling through realtime diff --git a/gcc/testsuite/gcc.dg/fdata-sections-1.c b/gcc/testsuite/gcc.dg/fdata-sections-1.c index 51686b9..e8a6639 100644 --- a/gcc/testsuite/gcc.dg/fdata-sections-1.c +++ b/gcc/testsuite/gcc.dg/fdata-sections-1.c @@ -1,7 +1,7 @@ /* PR middle-end/15486 */ /* Origin: Jonathan Larmour */ -/* { dg-do compile { target *-*-linux* *-*-gnu* } } */ +/* { dg-do compile { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-fdata-sections" } */ int x; diff --git a/gcc/testsuite/gcc.dg/fdata-sections-2.c b/gcc/testsuite/gcc.dg/fdata-sections-2.c index dda90ba7..48d44a2 100644 --- a/gcc/testsuite/gcc.dg/fdata-sections-2.c +++ b/gcc/testsuite/gcc.dg/fdata-sections-2.c @@ -4,7 +4,7 @@ /* This checks that string constants are put in per-function rodata sections, so that they can be garbage collected. */ -/* { dg-do compile { target *-*-linux* } } */ +/* { dg-do compile { target *-*-linux* *-*-uclinux* } } */ /* { dg-options "-O -ffunction-sections -fdata-sections" } */ const char *f1(void) { return "falderalde"; } diff --git a/gcc/testsuite/gcc.dg/pr39323-1.c b/gcc/testsuite/gcc.dg/pr39323-1.c index 7a7fd63..d84009c 100644 --- a/gcc/testsuite/gcc.dg/pr39323-1.c +++ b/gcc/testsuite/gcc.dg/pr39323-1.c @@ -1,5 +1,5 @@ /* PR c/39323 - MAX_OFILE_ALIGNMENT in elfos.h is too big */ -/* { dg-do compile { target *-*-linux* *-*-gnu* } } */ +/* { dg-do compile { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ int foo __attribute__ ((aligned(1 << 29))) = 20; /* { dg-error "requested alignment" } */ typedef int __attribute__ ((aligned(1 << 29))) int29; /* { dg-error "requested alignment" } */ diff --git a/gcc/testsuite/gcc.dg/pr39323-2.c b/gcc/testsuite/gcc.dg/pr39323-2.c index a870729..6b6cb2e 100644 --- a/gcc/testsuite/gcc.dg/pr39323-2.c +++ b/gcc/testsuite/gcc.dg/pr39323-2.c @@ -1,5 +1,5 @@ /* PR c/39323 */ -/* { dg-do compile { target *-*-linux* *-*-gnu* } } */ +/* { dg-do compile { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ int bar __attribute__ ((aligned(1 << 28))) = 20; diff --git a/gcc/testsuite/gcc.dg/pr39323-3.c b/gcc/testsuite/gcc.dg/pr39323-3.c index b452d3c..2e2c1a2 100644 --- a/gcc/testsuite/gcc.dg/pr39323-3.c +++ b/gcc/testsuite/gcc.dg/pr39323-3.c @@ -1,5 +1,5 @@ /* PR c/39323 */ -/* { dg-do compile { target *-*-linux* *-*-gnu* } } */ +/* { dg-do compile { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ typedef int __attribute__ ((aligned(1 << 28))) int28; int28 foo = 20; diff --git a/gcc/testsuite/gcc.dg/pr65780-1.c b/gcc/testsuite/gcc.dg/pr65780-1.c index b586211..5e3226e 100644 --- a/gcc/testsuite/gcc.dg/pr65780-1.c +++ b/gcc/testsuite/gcc.dg/pr65780-1.c @@ -1,5 +1,5 @@ /* PR target/65780 */ -/* { dg-do link { target *-*-linux* *-*-gnu* } } */ +/* { dg-do link { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2" } */ int optopt; diff --git a/gcc/testsuite/gcc.dg/pr65780-2.c b/gcc/testsuite/gcc.dg/pr65780-2.c index bff3323..932cbe1 100644 --- a/gcc/testsuite/gcc.dg/pr65780-2.c +++ b/gcc/testsuite/gcc.dg/pr65780-2.c @@ -1,5 +1,5 @@ /* PR target/65780 */ -/* { dg-do link { target *-*-linux* *-*-gnu* } } */ +/* { dg-do link { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-require-effective-target pie } */ /* { dg-options "-O2 -fpie" } */ diff --git a/gcc/testsuite/gcc.dg/pr67338.c b/gcc/testsuite/gcc.dg/pr67338.c index 0fdc302..7bfbef2 100644 --- a/gcc/testsuite/gcc.dg/pr67338.c +++ b/gcc/testsuite/gcc.dg/pr67338.c @@ -1,4 +1,4 @@ /* PR c/67338 */ -/* { dg-do compile { target *-*-linux* *-*-gnu* } } */ +/* { dg-do compile { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ struct S { __attribute__((aligned (1 << 28))) double a; }; diff --git a/gcc/testsuite/gcc.dg/pr78185.c b/gcc/testsuite/gcc.dg/pr78185.c index 405f748..d7781b2 100644 --- a/gcc/testsuite/gcc.dg/pr78185.c +++ b/gcc/testsuite/gcc.dg/pr78185.c @@ -1,4 +1,4 @@ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O" } */ #include diff --git a/gcc/testsuite/gcc.dg/pr83100-1.c b/gcc/testsuite/gcc.dg/pr83100-1.c index 233c1f6..ccfb8c6 100644 --- a/gcc/testsuite/gcc.dg/pr83100-1.c +++ b/gcc/testsuite/gcc.dg/pr83100-1.c @@ -1,5 +1,5 @@ /* PR target/83100 */ -/* { dg-do compile { target *-*-linux* *-*-gnu* } } */ +/* { dg-do compile { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fcommon -fdata-sections" } */ const int a; diff --git a/gcc/testsuite/gcc.dg/pr83100-4.c b/gcc/testsuite/gcc.dg/pr83100-4.c index bb26735..2f83247 100644 --- a/gcc/testsuite/gcc.dg/pr83100-4.c +++ b/gcc/testsuite/gcc.dg/pr83100-4.c @@ -1,5 +1,5 @@ /* PR target/83100 */ -/* { dg-do compile { target *-*-linux* *-*-gnu* } } */ +/* { dg-do compile { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fno-common -fdata-sections" } */ const int a; diff --git a/gcc/testsuite/gcc.dg/strlenopt-12g.c b/gcc/testsuite/gcc.dg/strlenopt-12g.c index f1dec1f..fb0eeb2 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-12g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-12g.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides stpcpy function. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strlenopt-14g.c b/gcc/testsuite/gcc.dg/strlenopt-14g.c index 1368ed3..81ddcc2 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-14g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-14g.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides stpcpy and mempcpy functions. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ /* Bionic targets don't have mempcpy */ /* { dg-require-effective-target non_bionic } */ diff --git a/gcc/testsuite/gcc.dg/strlenopt-14gf.c b/gcc/testsuite/gcc.dg/strlenopt-14gf.c index f7db2a8..54cff83 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-14gf.c +++ b/gcc/testsuite/gcc.dg/strlenopt-14gf.c @@ -1,6 +1,6 @@ /* This test needs runtime that provides stpcpy, mempcpy and __*_chk functions. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ /* Bionic targets don't have mempcpy */ /* { dg-require-effective-target non_bionic } */ diff --git a/gcc/testsuite/gcc.dg/strlenopt-16g.c b/gcc/testsuite/gcc.dg/strlenopt-16g.c index 816cbbc..e847a7a 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-16g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-16g.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides stpcpy function. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strlenopt-17g.c b/gcc/testsuite/gcc.dg/strlenopt-17g.c index aa86f78..9e6373c 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-17g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-17g.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides stpcpy function. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strlenopt-18g.c b/gcc/testsuite/gcc.dg/strlenopt-18g.c index de692e0..0c219b8 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-18g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-18g.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides stpcpy function. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strlenopt-1f.c b/gcc/testsuite/gcc.dg/strlenopt-1f.c index 4e3abd9..e7d817f 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-1f.c +++ b/gcc/testsuite/gcc.dg/strlenopt-1f.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides __*_chk functions. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinu* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define FORTIFY_SOURCE 2 diff --git a/gcc/testsuite/gcc.dg/strlenopt-22g.c b/gcc/testsuite/gcc.dg/strlenopt-22g.c index 1ecb85e..6ee6bef 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-22g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-22g.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides stpcpy function. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strlenopt-2f.c b/gcc/testsuite/gcc.dg/strlenopt-2f.c index 5786f8a..c0c7f38 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-2f.c +++ b/gcc/testsuite/gcc.dg/strlenopt-2f.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides __*_chk functions. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define FORTIFY_SOURCE 2 diff --git a/gcc/testsuite/gcc.dg/strlenopt-31g.c b/gcc/testsuite/gcc.dg/strlenopt-31g.c index 4eff864..eee4b57 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-31g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-31g.c @@ -1,4 +1,4 @@ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strlenopt-33g.c b/gcc/testsuite/gcc.dg/strlenopt-33g.c index a814160..1950008 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-33g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-33g.c @@ -1,4 +1,4 @@ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strlenopt-4g.c b/gcc/testsuite/gcc.dg/strlenopt-4g.c index 88dcec6..bf8aebb 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-4g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-4g.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides stpcpy function. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strlenopt-4gf.c b/gcc/testsuite/gcc.dg/strlenopt-4gf.c index 033661a..16eb5b0 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-4gf.c +++ b/gcc/testsuite/gcc.dg/strlenopt-4gf.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides stpcpy and __*_chk functions. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strncmp-2.c b/gcc/testsuite/gcc.dg/strncmp-2.c index f5555ba..6818b30 100644 --- a/gcc/testsuite/gcc.dg/strncmp-2.c +++ b/gcc/testsuite/gcc.dg/strncmp-2.c @@ -1,5 +1,5 @@ /* Test strncmp builtin expansion for compilation and proper execution. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2" } */ /* { dg-require-effective-target ptr32plus } */ diff --git a/gcc/testsuite/gcc.dg/struct-ret-3.c b/gcc/testsuite/gcc.dg/struct-ret-3.c index 4083bb4..4c0a0e6 100644 --- a/gcc/testsuite/gcc.dg/struct-ret-3.c +++ b/gcc/testsuite/gcc.dg/struct-ret-3.c @@ -1,7 +1,7 @@ /* PR middle-end/31309 */ /* Origin: Peeter Joot */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-add-options stack_size } */ #include diff --git a/gcc/testsuite/gcc.dg/torture/pr69760.c b/gcc/testsuite/gcc.dg/torture/pr69760.c index 8f24608..53733c7 100644 --- a/gcc/testsuite/gcc.dg/torture/pr69760.c +++ b/gcc/testsuite/gcc.dg/torture/pr69760.c @@ -1,5 +1,5 @@ /* PR tree-optimization/69760 */ -/* { dg-do run { target { { *-*-linux* *-*-gnu* } && mmap } } } */ +/* { dg-do run { target { { *-*-linux* *-*-gnu* *-*-uclinux* } && mmap } } } */ /* { dg-options "-O2" } */ #include diff --git a/gcc/testsuite/gcc.target/arm/div64-unwinding.c b/gcc/testsuite/gcc.target/arm/div64-unwinding.c index 7f112ee..0944281 100644 --- a/gcc/testsuite/gcc.target/arm/div64-unwinding.c +++ b/gcc/testsuite/gcc.target/arm/div64-unwinding.c @@ -1,6 +1,6 @@ /* Performing a 64-bit division should not pull in the unwinder. */ -/* { dg-do run { target { ! *-*-linux* } } } */ +/* { dg-do run { target { { ! *-*-linux* } && { ! *-*-uclinux* } } } } */ /* { dg-options "-O0" } */ #include diff --git a/gcc/testsuite/gcc.target/arm/pr66912.c b/gcc/testsuite/gcc.target/arm/pr66912.c index 27e4c45..7e6294c 100644 --- a/gcc/testsuite/gcc.target/arm/pr66912.c +++ b/gcc/testsuite/gcc.target/arm/pr66912.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target *-*-linux* } } */ +/* { dg-do compile { target *-*-linux* arm*-*-uclinuxfdpiceabi } } */ /* { dg-options "-O2 -fpic" } */ __attribute__((visibility("protected"))) diff --git a/gcc/testsuite/gcc.target/arm/stack-checking.c b/gcc/testsuite/gcc.target/arm/stack-checking.c index 4b53bed..9d1d2b0 100644 --- a/gcc/testsuite/gcc.target/arm/stack-checking.c +++ b/gcc/testsuite/gcc.target/arm/stack-checking.c @@ -1,4 +1,4 @@ -/* { dg-do run { target { *-*-linux* } } } */ +/* { dg-do run { target { *-*-linux* *-*-uclinux* } } } */ /* { dg-require-stack-check "" } */ /* { dg-options "-fstack-check" } */ diff --git a/gcc/testsuite/gcc.target/arm/synchronize.c b/gcc/testsuite/gcc.target/arm/synchronize.c index 7ef10e2..912f407 100644 --- a/gcc/testsuite/gcc.target/arm/synchronize.c +++ b/gcc/testsuite/gcc.target/arm/synchronize.c @@ -1,4 +1,4 @@ -/* { dg-final { scan-assembler "__sync_synchronize|dmb|mcr" { target arm*-*-linux-* } } } */ +/* { dg-final { scan-assembler "__sync_synchronize|dmb|mcr" { target arm*-*-linux-* arm*-*-uclinux* } } } */ void *foo (void) { diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index e32d424..0b67e10 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -1202,6 +1202,7 @@ proc check_effective_target_pie { } { || [istarget *-*-dragonfly*] || [istarget *-*-freebsd*] || [istarget *-*-linux*] + || [istarget arm*-*-uclinuxfdpiceabi] || [istarget *-*-gnu*] || [istarget *-*-amdhsa]} { return 1; @@ -6853,6 +6854,7 @@ proc check_effective_target_sync_long_long_runtime { } { } "" }]) || [istarget aarch64*-*-*] + || [istarget arm*-*-uclinuxfdpiceabi] || ([istarget arm*-*-linux-*] && [check_runtime sync_longlong_runtime { #include @@ -6912,6 +6914,7 @@ proc check_effective_target_sync_int_long { } { || [istarget aarch64*-*-*] || [istarget alpha*-*-*] || [istarget arm*-*-linux-*] + || [istarget arm*-*-uclinuxfdpiceabi] || ([istarget arm*-*-*] && [check_effective_target_arm_acq_rel]) || [istarget bfin*-*linux*] @@ -6935,6 +6938,7 @@ proc check_effective_target_sync_char_short { } { || [istarget i?86-*-*] || [istarget x86_64-*-*] || [istarget alpha*-*-*] || [istarget arm*-*-linux-*] + || [istarget arm*-*-uclinuxfdpiceabi] || ([istarget arm*-*-*] && [check_effective_target_arm_acq_rel]) || [istarget hppa*-*linux*] From patchwork Mon Sep 9 15:45:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 1159823 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-508660-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="VHZl5+u0"; dkim=pass (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="szhe4Xk8"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46Rt2L6RM9z9s00 for ; Tue, 10 Sep 2019 01:51:54 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; q=dns; s=default; b=B7H7aLPmXt6oQny/I0qLZUA4I49BA 7ejBL3/9avxrZp3HmG5L8AW1O5CaShzyDiD+1eQt/oQxG3Cej1BJiBWFC1bMzxH+ ro9UxqbmKugauuNJ8ajhzf+6iY9ktwGgi1vE/Td51yq/MHmX99zPbCGqV+suDYMT ug7lXi68f0SEyU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; s=default; bh=QUPymAHex8+xwmXT/kYEUEvCGCc=; b=VHZ l5+u0shQv/+fPlubYhYpWVSPqx0xncMfNKyKloe/l/ZrcFMjKwUb+mOCK3ex6z4U iuzpbTCAwLXshSK9DXmX6ClqdJ3jwTj/Afx1kkKpNwY6F9H4cLJz1Khn7shZCG7E KVlDfTzo2x3Mu98hwkknpIGp0AZJ9eCzpwioG5WY= Received: (qmail 8121 invoked by alias); 9 Sep 2019 15:51:46 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 7990 invoked by uid 89); 9 Sep 2019 15:51:46 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=sk:Wsugges, sk:wsugges X-HELO: mx07-00178001.pphosted.com Received: from mx08-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (91.207.212.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:51:44 +0000 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FpHtI007289 for ; Mon, 9 Sep 2019 17:51:41 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=v03MGAh9dunlD1jr7tJ7hiOjNO+/TXG8J+jJJLwu7pQ=; b=szhe4Xk8ZgA/7GRUmKQLBk2BhFeU0qySaYuNwFFW5wMXT2d/H+rOldZeo95j4ml1zk3E i79hntSyAsvZsMnpoOh+pFJ/TC4/1lamQT3sOi6RhDmFbB660//mrLke8mjiOuIAE7ee BmEtDXX/9U9W87viEjBAluROnbREhYewf4dQRGS5cDk5QkkLXPl7h3ssdjJ2k0BnPl6o UrxEDYFO+7n7qWIX8NHB59kUYUq6xoNtNR5aoDsFkvo1d+HL5VUTRCjYT6WZNHPTBCtQ rPZkaRWs9fnI+SM8aRgJYT9E5EmVrtyHdjOrCpTdgcfEXOBwQpkdFyK4Xri2uYim3z6N 9g== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx08-00178001.pphosted.com with ESMTP id 2uv1pa7197-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:51:41 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 899FF4B for ; Mon, 9 Sep 2019 15:51:37 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id BEA262B59EE for ; Mon, 9 Sep 2019 17:51:36 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:51:36 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 18/24] [ARM][testsuite] FDPIC: Enable tests on pie_enabled targets Date: Mon, 9 Sep 2019 17:45:00 +0200 Message-ID: <20190909154526.11630-19-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon Some tests have the "nonpic" guard, but pass on arm*-*-uclinuxfdpiceabi because it is in PIE mode by default. Rather than adding this target to all these tests, add the "pie_enabled" effective target. 2019-XX-XX Christophe Lyon gcc/testsuite/ * g++.dg/cpp0x/noexcept03.C: Add pie_enabled. * g++.dg/ipa/devirt-c-7.C: Likewise. * g++.dg/ipa/ivinline-1.C: Likewise. * g++.dg/ipa/ivinline-2.C: Likewise. * g++.dg/ipa/ivinline-3.C: Likewise. * g++.dg/ipa/ivinline-4.C: Likewise. * g++.dg/ipa/ivinline-5.C: Likewise. * g++.dg/ipa/ivinline-7.C: Likewise. * g++.dg/ipa/ivinline-8.C: Likewise. * g++.dg/ipa/ivinline-9.C: Likewise. * g++.dg/tls/pr79288.C: Likewise. * gcc.dg/addr_equal-1.c: Likewise. * gcc.dg/const-1.c: Likewise. * gcc.dg/ipa/pure-const-1.c: Likewise. * gcc.dg/noreturn-8.c: Likewise. * gcc.dg/pr33826.c: Likewise. * gcc.dg/torture/ipa-pta-1.c: Likewise. * gcc.dg/tree-ssa/alias-2.c: Likewise. * gcc.dg/tree-ssa/ipa-split-5.c: Likewise. * gcc.dg/tree-ssa/loadpre6.c: Likewise. * gcc.dg/uninit-19.c: Likewise. Change-Id: I1a0d836b892c23891f739fccdc467d0f354ab82c diff --git a/gcc/testsuite/g++.dg/cpp0x/noexcept03.C b/gcc/testsuite/g++.dg/cpp0x/noexcept03.C index 2d37867..906a44d 100644 --- a/gcc/testsuite/g++.dg/cpp0x/noexcept03.C +++ b/gcc/testsuite/g++.dg/cpp0x/noexcept03.C @@ -1,6 +1,6 @@ // Runtime test for noexcept-specification. // { dg-options "-Wnoexcept" } -// { dg-do run { target nonpic } } +// { dg-do run { target { nonpic || pie_enabled } } } // { dg-require-effective-target c++11 } #include diff --git a/gcc/testsuite/g++.dg/ipa/devirt-c-7.C b/gcc/testsuite/g++.dg/ipa/devirt-c-7.C index 2e76cbe..efb65c2 100644 --- a/gcc/testsuite/g++.dg/ipa/devirt-c-7.C +++ b/gcc/testsuite/g++.dg/ipa/devirt-c-7.C @@ -1,7 +1,6 @@ /* Verify that ipa-cp will not get confused by placement new constructing an object within another one when looking for dynamic type change . */ -/* { dg-do run } */ -/* { dg-require-effective-target nonpic } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -Wno-attributes" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-1.C b/gcc/testsuite/g++.dg/ipa/ivinline-1.C index 9b10d20..2d988bc 100644 --- a/gcc/testsuite/g++.dg/ipa/ivinline-1.C +++ b/gcc/testsuite/g++.dg/ipa/ivinline-1.C @@ -1,6 +1,6 @@ /* Verify that simple virtual calls are inlined even without early inlining. */ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-2.C b/gcc/testsuite/g++.dg/ipa/ivinline-2.C index 21cd46f..d978638 100644 --- a/gcc/testsuite/g++.dg/ipa/ivinline-2.C +++ b/gcc/testsuite/g++.dg/ipa/ivinline-2.C @@ -1,6 +1,6 @@ /* Verify that simple virtual calls using this pointer are inlined even without early inlining.. */ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-3.C b/gcc/testsuite/g++.dg/ipa/ivinline-3.C index 1e24644..f756a16 100644 --- a/gcc/testsuite/g++.dg/ipa/ivinline-3.C +++ b/gcc/testsuite/g++.dg/ipa/ivinline-3.C @@ -1,6 +1,6 @@ /* Verify that simple virtual calls on an object refrence are inlined even without early inlining. */ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-4.C b/gcc/testsuite/g++.dg/ipa/ivinline-4.C index cf0d980..5fbd3ef 100644 --- a/gcc/testsuite/g++.dg/ipa/ivinline-4.C +++ b/gcc/testsuite/g++.dg/ipa/ivinline-4.C @@ -1,7 +1,7 @@ /* Verify that simple virtual calls are inlined even without early inlining, even when a typecast to an ancestor is involved along the way. */ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-5.C b/gcc/testsuite/g++.dg/ipa/ivinline-5.C index f15ebf2..6c19907 100644 --- a/gcc/testsuite/g++.dg/ipa/ivinline-5.C +++ b/gcc/testsuite/g++.dg/ipa/ivinline-5.C @@ -1,6 +1,6 @@ /* Verify that virtual call inlining does not pick a wrong method when there is a user defined ancestor in an object. */ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-7.C b/gcc/testsuite/g++.dg/ipa/ivinline-7.C index a7b41e7..fd6aba6 100644 --- a/gcc/testsuite/g++.dg/ipa/ivinline-7.C +++ b/gcc/testsuite/g++.dg/ipa/ivinline-7.C @@ -1,7 +1,7 @@ /* Verify that simple virtual calls are inlined even without early inlining, even when a typecast to an ancestor is involved along the way and that ancestor is not the first one with virtual functions. */ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-8.C b/gcc/testsuite/g++.dg/ipa/ivinline-8.C index 5c3299f..bc81abf 100644 --- a/gcc/testsuite/g++.dg/ipa/ivinline-8.C +++ b/gcc/testsuite/g++.dg/ipa/ivinline-8.C @@ -1,6 +1,6 @@ /* Verify that virtual calls are inlined (ithout early inlining) even when their caller is itself indirectly inlined. */ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-9.C b/gcc/testsuite/g++.dg/ipa/ivinline-9.C index 41b2381..0917f15 100644 --- a/gcc/testsuite/g++.dg/ipa/ivinline-9.C +++ b/gcc/testsuite/g++.dg/ipa/ivinline-9.C @@ -2,7 +2,7 @@ inlining, even when a typecast to an ancestor is involved along the way and that ancestor itself has an ancestor wich is not the primary base class. */ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/tls/pr79288.C b/gcc/testsuite/g++.dg/tls/pr79288.C index 9f488df..da6751f 100644 --- a/gcc/testsuite/g++.dg/tls/pr79288.C +++ b/gcc/testsuite/g++.dg/tls/pr79288.C @@ -1,5 +1,5 @@ // PR c++/79288 -// { dg-do compile { target nonpic } } +// { dg-do compile { target { nonpic || pie_enabled } } } // { dg-require-effective-target tls } // { dg-options "-O2" } // { dg-final { scan-assembler-not "@tpoff" { target i?86-*-* x86_64-*-* } } } diff --git a/gcc/testsuite/gcc.dg/addr_equal-1.c b/gcc/testsuite/gcc.dg/addr_equal-1.c index 18b0dc9..35fa010 100644 --- a/gcc/testsuite/gcc.dg/addr_equal-1.c +++ b/gcc/testsuite/gcc.dg/addr_equal-1.c @@ -1,5 +1,4 @@ -/* { dg-do run } */ -/* { dg-require-effective-target nonpic } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-require-weak "" } */ /* { dg-require-alias "" } */ /* { dg-options "-O2 -fdelete-null-pointer-checks" } */ diff --git a/gcc/testsuite/gcc.dg/const-1.c b/gcc/testsuite/gcc.dg/const-1.c index 2e95bd8..5c2d49d 100644 --- a/gcc/testsuite/gcc.dg/const-1.c +++ b/gcc/testsuite/gcc.dg/const-1.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target nonpic } } */ +/* { dg-do compile { target { nonpic || pie_enabled } } } */ /* { dg-options "-O2 -Wsuggest-attribute=const -fno-finite-loops" } */ extern int extern_const(int a) __attribute__ ((const)); diff --git a/gcc/testsuite/gcc.dg/ipa/pure-const-1.c b/gcc/testsuite/gcc.dg/ipa/pure-const-1.c index 06b415e..dd58457 100644 --- a/gcc/testsuite/gcc.dg/ipa/pure-const-1.c +++ b/gcc/testsuite/gcc.dg/ipa/pure-const-1.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target nonpic } } */ +/* { dg-do compile { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-tree-local-pure-const1 -fdump-ipa-pure-const -fdump-tree-optimized -fno-early-inlining -fgnu89-inline" } */ void abort (void); int error_code; diff --git a/gcc/testsuite/gcc.dg/noreturn-8.c b/gcc/testsuite/gcc.dg/noreturn-8.c index 294800b..ce41cab 100644 --- a/gcc/testsuite/gcc.dg/noreturn-8.c +++ b/gcc/testsuite/gcc.dg/noreturn-8.c @@ -1,4 +1,4 @@ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O2" } */ void exit (int); void noreturn_autodetection_failed (); diff --git a/gcc/testsuite/gcc.dg/pr33826.c b/gcc/testsuite/gcc.dg/pr33826.c index df83915..d222774 100644 --- a/gcc/testsuite/gcc.dg/pr33826.c +++ b/gcc/testsuite/gcc.dg/pr33826.c @@ -1,8 +1,7 @@ /* Regression test for PR middle-end/33826 */ /* Verify that recursive functions cannot be pure or const. */ -/* { dg-do compile } */ -/* { dg-require-effective-target nonpic } */ +/* { dg-do compile { target { nonpic || pie_enabled } } } */ /* { dg-options "-O1 -fdump-tree-local-pure-const1 -fdump-ipa-pure-const" } */ int recurse1 (int); diff --git a/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c b/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c index 1bf4997..30156a3 100644 --- a/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c +++ b/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target { nonpic } } } */ +/* { dg-do compile { target { nonpic || pie_enabled } } } */ /* { dg-options "-fipa-pta -fdump-ipa-pta2 -fno-ipa-icf" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-fno-fat-lto-objects" } { "" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/alias-2.c b/gcc/testsuite/gcc.dg/tree-ssa/alias-2.c index e10a25d..f9d2dd4 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/alias-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/alias-2.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target { nonpic } } } */ +/* { dg-do compile { target { nonpic || pie_enabled } } } */ /* { dg-options "-O2 -fdump-tree-optimized" } */ static int a; int f; diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-5.c b/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-5.c index 2d713d6..3b5a94f 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-5.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-5.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target nonpic } } */ +/* { dg-do compile { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-tree-fnsplit -fdump-tree-optimized --param=builtin-expect-probability=100" } */ struct a {int a,b;}; diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c b/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c index 028becd..b4e9296 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target nonpic } } */ +/* { dg-do compile { target { nonpic || pie_enabled } } } */ /* { dg-options "-O2 -fdump-tree-pre-stats -fdump-tree-fre1" } */ #include From patchwork Mon Sep 9 15:45:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 1159824 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-508661-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="llBnrOw6"; dkim=pass (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="XKsoUxOT"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46Rt2f54JPz9s00 for ; Tue, 10 Sep 2019 01:52:10 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; q=dns; s=default; b=BDEkYwoDkOwKEUaPC/a4S+YT+/ved cD2THg82lmWmq4VAodMm13DdFHuRzGoFszzPzJFZI0J5+oGkiZVLoeeWZmuMj/Pa 90YYCVUjn5aaNDWEf2dnndntreRjRobhfnYPfohKlFyR3Z3iBRu3nye8YZQ4QTOA h0XxZNtW2oQpZw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; s=default; bh=zvBazwAUnEE7NnlGQXb55aDbnto=; b=llB nrOw6u0lORxm6RSYQEY0xQZMLgmQxoPKDZFrCo2lb1Beim0uHkKICCV+pc2bLV2K WUC0b9IEWxLGvn9qPGdZVl0KAuwwFlRE+hrrg0/44oVSPLUjBzMCcTHrvwMLMcHF FmTaZ2XoZcFCT4iyHsNbBat1PQ+5lHmzFZLKmeDM= Received: (qmail 11130 invoked by alias); 9 Sep 2019 15:52:03 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 11111 invoked by uid 89); 9 Sep 2019 15:52:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx07-00178001.pphosted.com Received: from mx08-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (91.207.212.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:52:02 +0000 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89Fovrx007207 for ; Mon, 9 Sep 2019 17:52:00 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=dQRMLgAbo1vMy722l76MCjA0bw6FaldqVVCKZLG9wTA=; b=XKsoUxOT9Ta1QDrpQy+ZcSWc56OlJaIa3mtE1erk2m2MGvj2w/04qCDHaSxy4jU1DJly dt/3uP3TZIHv8dDHFUVS8DH0irkJyTOazNLevN4V9gtZUqM3ovgyWwwircMzR7aKW4MR NREnrKAAAgHGgvL2NCBY5PXgSh5SGbs4X5OC36bjtlJfIe9PtHA20hg2KeJpAErHxFWD OLh2JZFYr5viIO6JdRIcRPqcYxzYWVbNAvexAM85IxFk+GFBDnAB/Acgjup1K7UApKM/ /24PVSXxzL6a/9XiBKI2FYGwMwkkjAVLI9qbhX7psnGCp747D5VYtc0qNMm/Dsy7w+MR Cg== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx08-00178001.pphosted.com with ESMTP id 2uv1pa71b4-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:52:00 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 84F6E23 for ; Mon, 9 Sep 2019 15:51:57 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id EA3EB2B0DEF for ; Mon, 9 Sep 2019 17:51:56 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:51:56 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 19/24] [ARM][testsuite] FDPIC: Adjust pr43698.c to avoid clash with uclibc. Date: Mon, 9 Sep 2019 17:45:01 +0200 Message-ID: <20190909154526.11630-20-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon uclibc defines bswap_32, so use a different name in this test. 2019-XX-XX Christophe Lyon gcc/testsuite/ * gcc.target/arm/pr43698.c (bswap_32): Rename as my_bswap_32. Change-Id: I2591bd911030814331cabf97ee5cf6cf8124b4f3 diff --git a/gcc/testsuite/gcc.target/arm/pr43698.c b/gcc/testsuite/gcc.target/arm/pr43698.c index 1fc497c..3b5dad0 100644 --- a/gcc/testsuite/gcc.target/arm/pr43698.c +++ b/gcc/testsuite/gcc.target/arm/pr43698.c @@ -6,7 +6,7 @@ char do_reverse_endian = 0; -# define bswap_32(x) \ +# define my_bswap_32(x) \ ((((x) & 0xff000000) >> 24) | \ (((x) & 0x00ff0000) >> 8) | \ (((x) & 0x0000ff00) << 8) | \ @@ -16,7 +16,7 @@ char do_reverse_endian = 0; (__extension__ ({ \ uint64_t __res; \ if (!do_reverse_endian) { __res = (X); \ - } else if (sizeof(X) == 4) { __res = bswap_32((X)); \ + } else if (sizeof(X) == 4) { __res = my_bswap_32((X)); \ } \ __res; \ })) From patchwork Mon Sep 9 15:45:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 1159826 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-508663-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Myf/xHkw"; dkim=pass (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="VgDuK/QI"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46Rt390SQcz9s7T for ; Tue, 10 Sep 2019 01:52:36 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; q=dns; s=default; b=H42Lu5lJDxmS4Cnf5kx5lbQdwnpot eCbl/z9Yu/nipkx2nCs+hi85nHgMcCH8kpsuyS4AogOB4/Vyak0wyo/bgvUBxrfk Ex7TCrQN34whtobQkLP0c8rJyVXr6R9l0OImJ61VNDT+2ATdf0nez/bz7eHlCdgQ l8IAkgpXV2Je1k= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; s=default; bh=c7Yt82sxlCVF0oXjGdmDlcbkKLU=; b=Myf /xHkwC+MjQ8E34q505DiCzHXTJnFfqDJmy3F2wfPqNUPzB5YpeWpPttvmUNtAvtK 3+Wjf1dI74+E/2KFiBbCowVyTEkuBDqX2X4cJfldprDGUthyXZ3lPkgMnpPE64vG ertGugQSrpuhlSVgeZqKj988h8WT9zWr9avYmrxI= Received: (qmail 14009 invoked by alias); 9 Sep 2019 15:52:28 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 14001 invoked by uid 89); 9 Sep 2019 15:52:28 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:52:23 +0000 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FpQZa005679 for ; Mon, 9 Sep 2019 17:52:21 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=TVz4O9yPFS6es5/RfFVWRa2RR2SzUGbP5DdeZYJkoUM=; b=VgDuK/QITz3Y2YlQcY7eCUnXZ13cE0vQaxcQU4Lic98B8c19QZXc+IZIpPY7iFrzcmQE 48s4PoOF+myj8t3aoEen6lQ04Zsxpscrz5TYf1p/Z1bg6PAaGyIOgnpi+Io+9t+CQvlP YcN3e5OP8vR6tuwslPgaprMpYua+h/865OUS8EgZ9sa5AFSVky24RO7jRvdRmJ5ERC4d zvDT9LXHxTFQe7wUA48urwNmF9tONHOX7NLjZTfwW9hdofCjndrGouMKV0UoVKz05jEP gBo7MncX0MyDucmSn1qk64n5QpXZXBg1M3v3ycuDt4i4aI6AexpW6icDVaefVrZJBsXA nA== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com with ESMTP id 2uv2avxhyb-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:52:21 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id B790A23 for ; Mon, 9 Sep 2019 15:52:17 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 2BF5E2B5A0F for ; Mon, 9 Sep 2019 17:52:17 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:52:16 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 20/24] [ARM][testsuite] FDPIC: Skip tests using architectures unsupported by FDPIC Date: Mon, 9 Sep 2019 17:45:02 +0200 Message-ID: <20190909154526.11630-21-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon Since FDPIC currently supports arm and thumb-2 modes only, these tests fail because they enforce an architecture version that doesn't match these restrictions. This patch introduces new values for the arm_arch effective-target (v4t_thumb, v5t_thumb, v5te_thumb, v6_thumb, v6k_thumb, v6z_thumb) as needed, and adds them to the relevant tests. In addition, it adds v4t_arm, v5t_arm, v5te_arm, v6_arm, v6k_arm and v6z_arm to avoid skipping some tests when GCC is configured to generate Thumb code by default. It also adds the corresponding non-thumb effective-target to the tests that were missing it. The existing v4t, v5t, v5te, v6 v6k and v6z effective-targets now force -mfloat-abi=softfp since these thumb-1 targets do not support hard-float anyway. Finally, the patch removes the special case to detect the presence of -marm in the flags, since it makes atomic_loaddi tests unsupported: since the flags in question also include -march, the combination is supported, while -marm alone is not if GCC is configured to target an M-profile CPU. 2019-XX-XX Christophe Lyon gcc/testsuite/ * lib/target-supports.exp (check_effective_target_arm_arch_FUNC_ok): Add v4t_arm, v4t_thumb, v5t_arm, v5t_thumb, v5te_arm, v5te_thumb, v6_arm, v6_thumb, v6k_arm, v6k_thumb, v6z_arm, v6z_thumb. Add -mfloat-abi=softfp to v4t, v5t, v5te, v6, v6k, v6z. Remove early exit for -marm. * gcc.target/arm/armv6-unaligned-load-ice.c: Add arm_arch effective-target. * gcc.target/arm/attr-unaligned-load-ice.c: Likewise. * gcc.target/arm/ftest-armv4-arm.c: Likewise. * gcc.target/arm/ftest-armv4t-arm.c: Likewise. * gcc.target/arm/ftest-armv4t-thumb.c: Likewise. * gcc.target/arm/ftest-armv5t-arm.c: Likewise. * gcc.target/arm/ftest-armv5t-thumb.c: Likewise. * gcc.target/arm/ftest-armv5te-arm.c: Likewise. * gcc.target/arm/ftest-armv5te-thumb.c: Likewise. * gcc.target/arm/ftest-armv6-arm.c: Likewise. * gcc.target/arm/ftest-armv6-thumb.c: Likewise. * gcc.target/arm/ftest-armv6k-arm.c: Likewise. * gcc.target/arm/ftest-armv6k-thumb.c: Likewise. * gcc.target/arm/ftest-armv6m-thumb.c: Likewise. * gcc.target/arm/ftest-armv6t2-arm.c: Likewise. * gcc.target/arm/ftest-armv6t2-thumb.c: Likewise. * gcc.target/arm/ftest-armv6z-arm.c: Likewise. * gcc.target/arm/ftest-armv6z-thumb.c: Likewise. * gcc.target/arm/g2.c: Likewise. * gcc.target/arm/macro_defs1.c: Likewise. * gcc.target/arm/pr59858.c: Likewise. * gcc.target/arm/pr65647-2.c: Likewise. * gcc.target/arm/pr79058.c: Likewise. * gcc.target/arm/pr83712.c: Likewise. * gcc.target/arm/pragma_arch_switch_2.c: Likewise. * gcc.target/arm/scd42-1.c: Likewise. * gcc.target/arm/scd42-2.c: Likewise. * gcc.target/arm/scd42-3.c: Likewise. * gcc.c-torture/compile/pr82096.c: Fix arm_arch effective-target. * gcc.target/arm/attr_arm-err.c: Likewise. * gcc.target/arm/di-longlong64-sync-withldrexd.c: Likewise. Change-Id: I0845b262b241026561cc52a19ff8bb1659675e49 diff --git a/gcc/testsuite/gcc.c-torture/compile/pr82096.c b/gcc/testsuite/gcc.c-torture/compile/pr82096.c index d144b70..4e695cd 100644 --- a/gcc/testsuite/gcc.c-torture/compile/pr82096.c +++ b/gcc/testsuite/gcc.c-torture/compile/pr82096.c @@ -1,4 +1,4 @@ -/* { dg-require-effective-target arm_arch_v5t_ok { target arm*-*-* } } */ +/* { dg-require-effective-target arm_arch_v5t_thumb_ok { target arm*-*-* } } */ /* { dg-skip-if "Do not combine float-abi values" { arm*-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=soft" } } */ /* { dg-additional-options "-march=armv5t -mthumb -mfloat-abi=soft" { target arm*-*-* } } */ diff --git a/gcc/testsuite/gcc.target/arm/armv6-unaligned-load-ice.c b/gcc/testsuite/gcc.target/arm/armv6-unaligned-load-ice.c index 88528f1..886a012 100644 --- a/gcc/testsuite/gcc.target/arm/armv6-unaligned-load-ice.c +++ b/gcc/testsuite/gcc.target/arm/armv6-unaligned-load-ice.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6k" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6k_thumb_ok } */ /* { dg-options "-mthumb -Os -mfloat-abi=softfp" } */ /* { dg-add-options arm_arch_v6k } */ diff --git a/gcc/testsuite/gcc.target/arm/attr-unaligned-load-ice.c b/gcc/testsuite/gcc.target/arm/attr-unaligned-load-ice.c index e1ed1c1..2eeb522 100644 --- a/gcc/testsuite/gcc.target/arm/attr-unaligned-load-ice.c +++ b/gcc/testsuite/gcc.target/arm/attr-unaligned-load-ice.c @@ -2,6 +2,7 @@ Verify that unaligned_access is correctly with attribute target. */ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6" } } */ +/* { dg-require-effective-target arm_arch_v6_ok } */ /* { dg-options "-Os -mfloat-abi=softfp -mtp=soft" } */ /* { dg-add-options arm_arch_v6 } */ diff --git a/gcc/testsuite/gcc.target/arm/attr_arm-err.c b/gcc/testsuite/gcc.target/arm/attr_arm-err.c index 630c06a..67d572a 100644 --- a/gcc/testsuite/gcc.target/arm/attr_arm-err.c +++ b/gcc/testsuite/gcc.target/arm/attr_arm-err.c @@ -1,7 +1,7 @@ /* Check that attribute target arm is rejected for M profile. */ /* { dg-do compile } */ -/* { dg-require-effective-target arm_arm_ok } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6-m" } } */ +/* { dg-require-effective-target arm_arch_v6m_ok } */ /* { dg-add-options arm_arch_v6m } */ int __attribute__((target("arm"))) diff --git a/gcc/testsuite/gcc.target/arm/di-longlong64-sync-withldrexd.c b/gcc/testsuite/gcc.target/arm/di-longlong64-sync-withldrexd.c index 517c4a8..befb7ec 100644 --- a/gcc/testsuite/gcc.target/arm/di-longlong64-sync-withldrexd.c +++ b/gcc/testsuite/gcc.target/arm/di-longlong64-sync-withldrexd.c @@ -1,7 +1,6 @@ /* { dg-do compile } */ -/* { dg-require-effective-target arm_arm_ok } */ /* { dg-options "-marm -std=gnu99" } */ -/* { dg-require-effective-target arm_arch_v6k_ok } */ +/* { dg-require-effective-target arm_arch_v6k_arm_ok } */ /* { dg-add-options arm_arch_v6k } */ /* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "fetch_and_nand" { target *-*-* } 0 } */ /* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "nand_and_fetch" { target *-*-* } 0 } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv4-arm.c b/gcc/testsuite/gcc.target/arm/ftest-armv4-arm.c index 4b48ef8..447a8ec 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv4-arm.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv4-arm.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv4" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v4_ok } */ /* { dg-options "-marm" } */ /* { dg-add-options arm_arch_v4 } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv4t-arm.c b/gcc/testsuite/gcc.target/arm/ftest-armv4t-arm.c index 016506f..28fd2f7 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv4t-arm.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv4t-arm.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv4t" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v4t_arm_ok } */ /* { dg-options "-marm" } */ /* { dg-add-options arm_arch_v4t } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv4t-thumb.c b/gcc/testsuite/gcc.target/arm/ftest-armv4t-thumb.c index 9ef944e..78878f7 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv4t-thumb.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv4t-thumb.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv4t" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v4t_thumb_ok } */ /* { dg-options "-mthumb" } */ /* { dg-add-options arm_arch_v4t } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv5t-arm.c b/gcc/testsuite/gcc.target/arm/ftest-armv5t-arm.c index a9403e9..8191299 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv5t-arm.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv5t-arm.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv5t" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v5t_arm_ok } */ /* { dg-options "-marm" } */ /* { dg-add-options arm_arch_v5t } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv5t-thumb.c b/gcc/testsuite/gcc.target/arm/ftest-armv5t-thumb.c index f3ad07e..b25d17d 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv5t-thumb.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv5t-thumb.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv5t" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v5t_thumb_ok } */ /* { dg-options "-mthumb" } */ /* { dg-add-options arm_arch_v5t } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv5te-arm.c b/gcc/testsuite/gcc.target/arm/ftest-armv5te-arm.c index f98c01a..e0c0d5c 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv5te-arm.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv5te-arm.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv5te" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v5te_arm_ok } */ /* { dg-options "-marm" } */ /* { dg-add-options arm_arch_v5te } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv5te-thumb.c b/gcc/testsuite/gcc.target/arm/ftest-armv5te-thumb.c index 5d71787..27a64a2 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv5te-thumb.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv5te-thumb.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv5te" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v5te_thumb_ok } */ /* { dg-options "-mthumb" } */ /* { dg-add-options arm_arch_v5te } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6-arm.c b/gcc/testsuite/gcc.target/arm/ftest-armv6-arm.c index 88a5089..5d447c3 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6-arm.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6-arm.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6_arm_ok } */ /* { dg-options "-marm" } */ /* { dg-add-options arm_arch_v6 } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6-thumb.c b/gcc/testsuite/gcc.target/arm/ftest-armv6-thumb.c index 90ef9d2..15a6d75 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6-thumb.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6-thumb.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6_thumb_ok } */ /* { dg-options "-mthumb" } */ /* { dg-add-options arm_arch_v6 } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6k-arm.c b/gcc/testsuite/gcc.target/arm/ftest-armv6k-arm.c index 8de021a..0656e8f 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6k-arm.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6k-arm.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6k" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6k_arm_ok } */ /* { dg-options "-marm" } */ /* { dg-add-options arm_arch_v6k } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6k-thumb.c b/gcc/testsuite/gcc.target/arm/ftest-armv6k-thumb.c index c2fc270..b3b6ecf 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6k-thumb.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6k-thumb.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6k" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6k_thumb_ok } */ /* { dg-options "-mthumb" } */ /* { dg-add-options arm_arch_v6k } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6m-thumb.c b/gcc/testsuite/gcc.target/arm/ftest-armv6m-thumb.c index ee075e2..27f71be 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6m-thumb.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6m-thumb.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6-m" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6m_ok } */ /* { dg-options "-mthumb" } */ /* { dg-add-options arm_arch_v6m } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6t2-arm.c b/gcc/testsuite/gcc.target/arm/ftest-armv6t2-arm.c index 83b4bc4..259d2b5 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6t2-arm.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6t2-arm.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6t2" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6t2_ok } */ /* { dg-options "-marm" } */ /* { dg-add-options arm_arch_v6t2 } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6t2-thumb.c b/gcc/testsuite/gcc.target/arm/ftest-armv6t2-thumb.c index 1a1cbc5..e624ec5 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6t2-thumb.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6t2-thumb.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6t2" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6t2_ok } */ /* { dg-options "-mthumb" } */ /* { dg-add-options arm_arch_v6t2 } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6z-arm.c b/gcc/testsuite/gcc.target/arm/ftest-armv6z-arm.c index e2df0d4..6e3a966 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6z-arm.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6z-arm.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6z" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6z_arm_ok } */ /* { dg-options "-marm" } */ /* { dg-add-options arm_arch_v6z } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6z-thumb.c b/gcc/testsuite/gcc.target/arm/ftest-armv6z-thumb.c index e4b94ef..23a4fcd 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6z-thumb.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6z-thumb.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6z" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6z_thumb_ok } */ /* { dg-options "-mthumb" } */ /* { dg-add-options arm_arch_v6z } */ diff --git a/gcc/testsuite/gcc.target/arm/g2.c b/gcc/testsuite/gcc.target/arm/g2.c index e368017..ca5e3cc 100644 --- a/gcc/testsuite/gcc.target/arm/g2.c +++ b/gcc/testsuite/gcc.target/arm/g2.c @@ -4,6 +4,7 @@ /* { dg-skip-if "Test is specific to the Xscale" { arm*-*-* } { "-march=*" } { "-march=xscale" } } */ /* { dg-skip-if "Test is specific to the Xscale" { arm*-*-* } { "-mcpu=*" } { "-mcpu=xscale" } } */ /* { dg-skip-if "Test is specific to ARM mode" { arm*-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v5te_arm_ok } */ /* { dg-require-effective-target arm32 } */ /* Brett Gaines' test case. */ diff --git a/gcc/testsuite/gcc.target/arm/macro_defs1.c b/gcc/testsuite/gcc.target/arm/macro_defs1.c index 4cc9ae6..655ba93 100644 --- a/gcc/testsuite/gcc.target/arm/macro_defs1.c +++ b/gcc/testsuite/gcc.target/arm/macro_defs1.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6-m" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6m_ok } */ /* { dg-options "-march=armv6-m -mthumb" } */ #ifdef __ARM_NEON_FP diff --git a/gcc/testsuite/gcc.target/arm/pr59858.c b/gcc/testsuite/gcc.target/arm/pr59858.c index a944b9a..bcfd5d5 100644 --- a/gcc/testsuite/gcc.target/arm/pr59858.c +++ b/gcc/testsuite/gcc.target/arm/pr59858.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-march=armv5te -fno-builtin -mfloat-abi=soft -mthumb -fno-stack-protector -Os -fno-tree-loop-optimize -fno-tree-dominator-opts -fPIC -w" } */ /* { dg-skip-if "Incompatible command line options: -mfloat-abi=soft -mfloat-abi=hard" { *-*-* } { "-mfloat-abi=hard" } { "" } } */ +/* { dg-require-effective-target arm_arch_v5te_thumb_ok } */ typedef enum { REG_ENOSYS = -1, diff --git a/gcc/testsuite/gcc.target/arm/pr65647-2.c b/gcc/testsuite/gcc.target/arm/pr65647-2.c index f2985f8..e3978e5 100644 --- a/gcc/testsuite/gcc.target/arm/pr65647-2.c +++ b/gcc/testsuite/gcc.target/arm/pr65647-2.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-require-effective-target arm_arch_v6_arm_ok } */ /* { dg-options "-O3 -marm -march=armv6 -std=c99" } */ typedef struct { diff --git a/gcc/testsuite/gcc.target/arm/pr79058.c b/gcc/testsuite/gcc.target/arm/pr79058.c index 54a1d8a..7d078ac 100644 --- a/gcc/testsuite/gcc.target/arm/pr79058.c +++ b/gcc/testsuite/gcc.target/arm/pr79058.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-require-effective-target arm_arm_ok } */ +/* { dg-require-effective-target arm_arch_v4_ok } */ /* { dg-skip-if "do not override -mcpu" { *-*-* } { "-mcpu=*" } { "-mcpu=arm7tdmi" } } */ /* { dg-options "-Os -mbig-endian -marm -mcpu=arm7tdmi" } */ diff --git a/gcc/testsuite/gcc.target/arm/pr83712.c b/gcc/testsuite/gcc.target/arm/pr83712.c index 8ed8cdf..4902ec9 100644 --- a/gcc/testsuite/gcc.target/arm/pr83712.c +++ b/gcc/testsuite/gcc.target/arm/pr83712.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-require-effective-target arm_arch_v5t_thumb_ok } */ /* { dg-options "-mfloat-abi=softfp -mthumb -march=armv5t -O2" } */ #pragma GCC optimize ("-O2") diff --git a/gcc/testsuite/gcc.target/arm/pragma_arch_switch_2.c b/gcc/testsuite/gcc.target/arm/pragma_arch_switch_2.c index b6211f9..5080d2c 100644 --- a/gcc/testsuite/gcc.target/arm/pragma_arch_switch_2.c +++ b/gcc/testsuite/gcc.target/arm/pragma_arch_switch_2.c @@ -2,6 +2,7 @@ /* { dg-skip-if "instruction not valid on thumb" { *-*-* } { "-mthumb" } { "" } } */ /* { dg-do assemble } */ /* { dg-require-effective-target arm_arm_ok } */ +/* { dg-require-effective-target arm_arch_v5te_arm_ok } */ /* { dg-additional-options "-Wall -O2 -march=armv5te -std=gnu99 -marm" } */ #pragma GCC target ("arch=armv6") diff --git a/gcc/testsuite/gcc.target/arm/scd42-1.c b/gcc/testsuite/gcc.target/arm/scd42-1.c index be60e64..2b8fc0b 100644 --- a/gcc/testsuite/gcc.target/arm/scd42-1.c +++ b/gcc/testsuite/gcc.target/arm/scd42-1.c @@ -3,6 +3,7 @@ /* { dg-skip-if "Test is specific to Xscale" { arm*-*-* } { "-march=*" } { "-march=xscale" } } */ /* { dg-skip-if "Test is specific to Xscale" { arm*-*-* } { "-mcpu=*" } { "-mcpu=xscale" } } */ /* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=softfp" } } */ +/* { dg-require-effective-target arm_arch_v5te_ok } */ /* { dg-options "-mcpu=xscale -O -mfloat-abi=softfp" } */ unsigned load1(void) __attribute__ ((naked)); diff --git a/gcc/testsuite/gcc.target/arm/scd42-2.c b/gcc/testsuite/gcc.target/arm/scd42-2.c index 6d9e5e1..3c9768d 100644 --- a/gcc/testsuite/gcc.target/arm/scd42-2.c +++ b/gcc/testsuite/gcc.target/arm/scd42-2.c @@ -4,6 +4,7 @@ /* { dg-skip-if "Test is specific to the Xscale" { arm*-*-* } { "-mcpu=*" } { "-mcpu=xscale" } } */ /* { dg-skip-if "Test is specific to ARM mode" { arm*-*-* } { "-mthumb" } { "" } } */ /* { dg-require-effective-target arm32 } */ +/* { dg-require-effective-target arm_arch_v5te_arm_ok } */ /* { dg-options "-mcpu=xscale -O -marm" } */ unsigned load2(void) __attribute__ ((naked)); diff --git a/gcc/testsuite/gcc.target/arm/scd42-3.c b/gcc/testsuite/gcc.target/arm/scd42-3.c index e566cb2..0afd121 100644 --- a/gcc/testsuite/gcc.target/arm/scd42-3.c +++ b/gcc/testsuite/gcc.target/arm/scd42-3.c @@ -3,6 +3,7 @@ /* { dg-skip-if "Test is specific to Xscale" { arm*-*-* } { "-march=*" } { "-march=xscale" } } */ /* { dg-skip-if "Test is specific to Xscale" { arm*-*-* } { "-mcpu=*" } { "-mcpu=xscale" } } */ /* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=softfp" } } */ +/* { dg-require-effective-target arm_arch_v5te_ok } */ /* { dg-options "-mcpu=xscale -O -mfloat-abi=softfp" } */ unsigned load4(void) __attribute__ ((naked)); diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 0b67e10..1a1eed8 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -4181,13 +4181,25 @@ proc check_effective_target_arm_fp16_hw { } { # /* { dg-require-effective-target arm_arch_v5t_multilib } */ foreach { armfunc armflag armdefs } { v4 "-march=armv4 -marm" __ARM_ARCH_4__ - v4t "-march=armv4t" __ARM_ARCH_4T__ - v5t "-march=armv5t" __ARM_ARCH_5T__ - v5te "-march=armv5te" __ARM_ARCH_5TE__ - v6 "-march=armv6" __ARM_ARCH_6__ - v6k "-march=armv6k" __ARM_ARCH_6K__ + v4t "-march=armv4t -mfloat-abi=softfp" __ARM_ARCH_4T__ + v4t_arm "-march=armv4t -marm" __ARM_ARCH_4T__ + v4t_thumb "-march=armv4t -mthumb -mfloat-abi=softfp" __ARM_ARCH_4T__ + v5t "-march=armv5t -mfloat-abi=softfp" __ARM_ARCH_5T__ + v5t_arm "-march=armv5t -marm" __ARM_ARCH_5T__ + v5t_thumb "-march=armv5t -mthumb -mfloat-abi=softfp" __ARM_ARCH_5T__ + v5te "-march=armv5te -mfloat-abi=softfp" __ARM_ARCH_5TE__ + v5te_arm "-march=armv5te -marm" __ARM_ARCH_5TE__ + v5te_thumb "-march=armv5te -mthumb -mfloat-abi=softfp" __ARM_ARCH_5TE__ + v6 "-march=armv6 -mfloat-abi=softfp" __ARM_ARCH_6__ + v6_arm "-march=armv6 -marm" __ARM_ARCH_6__ + v6_thumb "-march=armv6 -mthumb -mfloat-abi=softfp" __ARM_ARCH_6__ + v6k "-march=armv6k -mfloat-abi=softfp" __ARM_ARCH_6K__ + v6k_arm "-march=armv6k -marm" __ARM_ARCH_6K__ + v6k_thumb "-march=armv6k -mthumb -mfloat-abi=softfp" __ARM_ARCH_6K__ v6t2 "-march=armv6t2" __ARM_ARCH_6T2__ - v6z "-march=armv6z" __ARM_ARCH_6Z__ + v6z "-march=armv6z -mfloat-abi=softfp" __ARM_ARCH_6Z__ + v6z_arm "-march=armv6z -marm" __ARM_ARCH_6Z__ + v6z_thumb "-march=armv6z -mthumb -mfloat-abi=softfp" __ARM_ARCH_6Z__ v6m "-march=armv6-m -mthumb -mfloat-abi=soft" __ARM_ARCH_6M__ v7a "-march=armv7-a" __ARM_ARCH_7A__ v7r "-march=armv7-r" __ARM_ARCH_7R__ @@ -4204,10 +4216,6 @@ foreach { armfunc armflag armdefs } { v8r "-march=armv8-r" __ARM_ARCH_8R__ } { eval [string map [list FUNC $armfunc FLAG $armflag DEFS $armdefs ] { proc check_effective_target_arm_arch_FUNC_ok { } { - if { [ string match "*-marm*" "FLAG" ] && - ![check_effective_target_arm_arm_ok] } { - return 0 - } return [check_no_compiler_messages arm_arch_FUNC_ok assembly { #if !(DEFS) #error !(DEFS) From patchwork Mon Sep 9 15:45:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 1159827 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-508664-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="bHRqjFeO"; dkim=pass (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="nJWkYjsn"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46Rt3T2qsGz9s00 for ; Tue, 10 Sep 2019 01:52:53 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; q=dns; s=default; b=ldO2MSK6RUBkO/A2zrbMzrw7n/1Aa Ud3K9L9xrEalw4tfEn/Jom3r5XwALNxr1IyEklO6SljDdI2mj7Ulc3Ehr2+mvgJz 2gqgl+irwVV7Wjw+SuAky72ARbemyRE4sl3hIszeCZJgGXpiaTrz4/3KquC8b+Hh 4rGEJzYj3OMOgU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; s=default; bh=3UDFXV9pbbMnwGZHEj7qzPcPMBU=; b=bHR qjFeOLd1m6iCIxKRQLFiNHc//QYMoF0LupwSTeadbUkAHFZq7ZSlZBWmD/khOS7r AjoMRjIf7x2gcMZqpCzklSrgSrbDOBCLZTpurJX5/Yo0+95QOWwA4aqsG7ju7hGt tgxNsC4nUCT4xDgWilGGpOpvgXmfJwDRpmbwmtWY= Received: (qmail 15722 invoked by alias); 9 Sep 2019 15:52:45 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 15695 invoked by uid 89); 9 Sep 2019 15:52:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=Forces X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:52:43 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FpDVT005008 for ; Mon, 9 Sep 2019 17:52:41 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=s8gMizsfcaRYbJor83rbYF1yUMEEU/FD4/NHXhPGA5E=; b=nJWkYjsngi+8iD49Can17VlhjLgIFhkfnrg90+CN1FunjweNAqrkhFZZEfIQo0dmAd2w ZfKy4WKBo6FDmtjMuwU46pSdgFPdFdQfoJeeBfQRvJNf0tEFB4zqmiCytPdTQuye5XjO Z3R6A81mvR0/ePY9zmLuG3sxB4+XlDuc2riGGSKFR8bXyUnfcuaYPrwri9wITicDOIAw mR+jcTKSh9+pFahAxyBIQ5CP8pZU/0ySVU060zEoT40RrIhqNjE15mwVIFVZrS8fWW+E ZpzmpH2J4DfO6V8hUXCb6OYtTeouFgdSc9AC7n06AP7hMGnDVSYRIlAI3L8HArwFryRX 0w== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com with ESMTP id 2uv212em2u-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:52:41 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id EB42624 for ; Mon, 9 Sep 2019 15:52:37 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 60A432B0DEF for ; Mon, 9 Sep 2019 17:52:37 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:52:37 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 21/24] [ARM] FDPIC: Handle stack-protector combined patterns Date: Mon, 9 Sep 2019 17:45:03 +0200 Message-ID: <20190909154526.11630-22-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon The recent stack_protect_combined_set_insn and stack_protect_combined_test_insn force recomputing of GOT base, but need to take into account that in FDPIC mode, the PIC register is fixed by the ABI (r9). 2019-XX-XX Christophe Lyon gcc/ * config/arm/arm.md (stack_protect_combined_set_insn): Handle FDPIC mode. (stack_protect_combined_test_insn): Likewise. Change-Id: I0e47cf30cfe0dc401f43bd728aaae07bffa4c9cc diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index 918271d..6513c2d 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -8270,8 +8270,15 @@ { if (flag_pic) { + rtx pic_reg; + + if (TARGET_FDPIC) + pic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + else + pic_reg = operands[3]; + /* Forces recomputing of GOT base now. */ - legitimize_pic_address (operands[1], SImode, operands[2], operands[3], + legitimize_pic_address (operands[1], SImode, operands[2], pic_reg, true /*compute_now*/); } else @@ -8346,8 +8353,15 @@ if (flag_pic) { + rtx pic_reg; + + if (TARGET_FDPIC) + pic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + else + pic_reg = operands[4]; + /* Forces recomputing of GOT base now. */ - legitimize_pic_address (operands[1], SImode, operands[3], operands[4], + legitimize_pic_address (operands[1], SImode, operands[3], pic_reg, true /*compute_now*/); } else From patchwork Mon Sep 9 15:45:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 1159829 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-508665-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Xv5LViPy"; dkim=pass (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="Um8RPSnX"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46Rt3v2fkCz9s00 for ; Tue, 10 Sep 2019 01:53:15 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; q=dns; s=default; b=TinK53+cBMbK5K3uAYt/wLIU1glJD lHyf4agzOXe83SMM0IQhHTaZvtBP31b21+69BY8m46vpmg9Vnr8yfrEye/eKrbfc 2FfF1cw51NXRjZs0JnsgAaK/SrhAEeA2h9SaU2o0Uc4oEkUe2gAfly2A1sQ7edoC KUsD/39WIOHB10= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; s=default; bh=tRqNe32T51muKip8m/8qJBhPySM=; b=Xv5 LViPyoPQsY9Kd1aSB54VuegXn1O2mSESSiKWL86U19K8VlIhcjSHYthcIYJK/D+r XdEWXRTnEiG63HFzagWmmqaAhfOaFPxGMhKvyueVvC3XGqhEKncAscjZImfcsz8/ jVQkT4vHBC3tu2WwQwy0tU9SwskbgObnybvAD/Oc= Received: (qmail 17299 invoked by alias); 9 Sep 2019 15:53:08 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 17291 invoked by uid 89); 9 Sep 2019 15:53:08 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:950 X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:53:07 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FpDKE005011 for ; Mon, 9 Sep 2019 17:53:05 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=xaotAcinz/jIDzJ2HqR9WGWqWDATad+Q9gId6hsvh6o=; b=Um8RPSnXu68c7e9l97KHoeEk+6MlROuXr1f9j0lRHCON/1QgBftl0wZ/jBWAPvCsqeKu ZhOqHXvALbJjf0l7tA3daGQR+1SpOg8v9LiqdsTetN3wlS5+3LHa662brDuzjFhcPqp7 6UDHudO2/mHJC4vxg3yr+rlrlDWIp5lPGijZQ4n1dDWFAF84UTBIaY6cW98voxgcGY+B 0xRyifnx91KswGmIbYENYhcuCvCeIM0W/1L+uWgd5HVtpImHRub0u9nrKJPMgL/x4lK4 xYa32Yl0FelfFRyRK8hCrxG0oF934p0zHgMAr/LAb3fCP+m1r8CuMA52ySvxC4HVXtvO +w== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com with ESMTP id 2uv212em54-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:53:05 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 2D32A24 for ; Mon, 9 Sep 2019 15:53:02 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 849E82B2E76 for ; Mon, 9 Sep 2019 17:52:57 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:52:57 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 22/24] [ARM][testsuite] FDPIC: Skip tests that require -static support Date: Mon, 9 Sep 2019 17:45:04 +0200 Message-ID: <20190909154526.11630-23-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon Since FDPIC does not support -static, skip the related tests. 2019-XX-XX Christophe Lyon gcc/testsuite/ * lib/target-supports.exp (check_effective_target_static): Disable for ARM FDPIC target. Change-Id: I119d0541e53f2f1e531540b20e7bc47d8338d89a diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 1a1eed8..19899ce 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -1083,6 +1083,9 @@ proc check_effective_target_pe_aligned_commons {} { # Return 1 if the target supports -static proc check_effective_target_static {} { + if { [istarget arm*-*-uclinuxfdpiceabi] } { + return 0; + } return [check_no_compiler_messages static executable { int main (void) { return 0; } } "-static"] From patchwork Mon Sep 9 15:45:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 1159830 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-508666-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="TJGXJ2pk"; dkim=pass (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="H8nnBptv"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46Rt4J6d3yz9s7T for ; Tue, 10 Sep 2019 01:53:36 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; q=dns; s=default; b=CsWr1CPiLyOihWHBZtUTBfVHSluIH iWRq9qaKglOhR/+nX1f62xuEwhGyxjVweY8Sb8THttyrEOfbCBMpWSzZRxtUKGho KKMHrBnMGsSPo7Gp335yWJ7kpeIkjwG3sZZCaFzMFX8gNp2p8TtWg3yNV1EYrcRk qLuGfNV2/BzoM0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; s=default; bh=YpjqxyXDyrb0cmKZ5KDxNiBfBW8=; b=TJG XJ2pkNAbyYTCABLj0BVoQjz0mTenf9C6TKIkjVvawQixRc1QFPFuUZUce/w7pQtb VYKzKa/npHGP7ABJVQMQPMWNlApl5m3ObvuryN+pz+LvlsF5JZqLWgpGIuXQPr5t 0VWVRv4Laq9iYdzPmU1NKo8sHmIgfxEdpB69M5+I= Received: (qmail 18835 invoked by alias); 9 Sep 2019 15:53:29 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 18822 invoked by uid 89); 9 Sep 2019 15:53:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=armv7-m, armv7m X-HELO: mx07-00178001.pphosted.com Received: from mx08-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (91.207.212.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:53:28 +0000 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FpHtZ007289 for ; Mon, 9 Sep 2019 17:53:26 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=SOkjjfACemC2p0XY5xL48RW5iBDf61PzVXxG+ERhVfM=; b=H8nnBptvCTji9LG3NUH3Hbj/EVptpKUkp9rAb7OLKfRT+fT5swFPOFiQeyYcDBfYUgFO 4BK1d2v6NBRVfN+xr6atpx6ENm2KGkXW62SUW3IogscWcvhOqAXLyu71RVEZNXKvR+eu kPD8Irw0ZtQ3cL9Ykodf876Gp6Q2qV3jbvjIr9u9OLFJ9ir8pbOfy33Vhd4re9NgBDKw 6232miIpKefK4JXJ5q4mZaJ8l6knt9Gac1tHb6CBE4j1Zb+PSl9HLnV/GM9SVIq6NCcs n+10P7fzSV6FJt4sBXKEi3PuqSUaFXD2OEZ4Lx3BTJ84IgAOtP3AuKenp62BZb7Haqk3 1g== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx08-00178001.pphosted.com with ESMTP id 2uv1pa71hk-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:53:26 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 5BE5A23 for ; Mon, 9 Sep 2019 15:53:23 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id B7F592B2E79 for ; Mon, 9 Sep 2019 17:53:17 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:53:17 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 23/24] [ARM] FDPIC: Implement libitm support. Date: Mon, 9 Sep 2019 17:45:05 +0200 Message-ID: <20190909154526.11630-24-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon The ldaddr macro in sjlj.S needs to be updated to support the FDPIC model. 2019-XX-XX Christophe Lyon libitm/ * config/arm/sjlj.S (ldaddr): Add FDPIC support. Change-Id: Ieb2c6613363341d109c3500af0575b133b17407d diff --git a/libitm/config/arm/sjlj.S b/libitm/config/arm/sjlj.S index a9abf16..5d44964 100644 --- a/libitm/config/arm/sjlj.S +++ b/libitm/config/arm/sjlj.S @@ -49,7 +49,16 @@ .arch armv7-m #endif -#if defined(HAVE_MOVT) && defined(PIC) +#if defined(__FDPIC__) +.macro ldaddr reg, addr + ldr \reg, 99f + add \reg, \reg, r9 +.subsection 1 + .align 2 +99: .word \addr(GOTOFF) +.subsection 0 +.endm +#elif defined(HAVE_MOVT) && defined(PIC) .macro ldaddr reg, addr movw \reg, #:lower16:(\addr - (98f + PC_OFS)) movt \reg, #:upper16:(\addr - (98f + PC_OFS)) From patchwork Mon Sep 9 15:45:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 1159831 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-508667-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="aML8FejC"; dkim=pass (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="zwpWl9u4"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46Rt4d1tR1z9s00 for ; Tue, 10 Sep 2019 01:53:52 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; q=dns; s=default; b=qj/8Ju/45z24ylf714+6OKh8xQVSe lu+evLRsfTRR5c+Dia4JSdi1nap6HetAqtYAOcy+3juvYJh8IZQW5WHhLBZnZj8d 6xxa8fJ6HUyT9yHGDJ7S+acN/JjBIUKvXti8yQ+I2L2hiRkWWzcOK5inlZRdhml8 fPPtb3s5bmkcxY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; s=default; bh=zM0ArLZxAk1N/hMAPaHEBSjgEHI=; b=aML 8FejC1bbbO6Cnmkz526xzbCbEbauBd2wzT0WjwIKjNNu4Nk+N2CDfRTz0WOntSJ4 olAjU3ohtsRpukKnR11sYKkVdSzqf96U8rLC6UTrdnVVmaxibnZprDoxbAo+G915 2Mjjd8cEzzZiFAI/WHe+fg3ixD0fjcmiatSKEh40= Received: (qmail 20394 invoked by alias); 9 Sep 2019 15:53:46 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 20386 invoked by uid 89); 9 Sep 2019 15:53:46 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx07-00178001.pphosted.com Received: from mx08-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (91.207.212.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:53:44 +0000 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FpHtf007289 for ; Mon, 9 Sep 2019 17:53:42 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=gRqDxlHZfUv1t/d3krrIPmxBTHPFbFa3KQs8wrKgneA=; b=zwpWl9u4JGutOmp3IZUuXarq78xELk3SWUP8MqDAVi98qcI379d+w2p5g3MZYXYUXZ49 V4QUhQJ9kldW/ughBV9isRCkcb5unAn4wdJ0qANO3aREf1qZmuGFGcX1eUwKEDVE7YAl h2olOV2gOkDQ/ui/L0G9dXTvEQgYYA+qga6Wbq6ygHW2HJpzw3fbfZYCvyYUiFGvOgUT YL36jvbxJLbjremFy1XLdPpnvc8xaXTtID3nAUnYM43kgW9aSDqqzbo++PBa6KXYUN0t /9G7j4JgjcXIC5S2vhdZszWyefp+XaFAz9ZeUT/IlmtCzSw2MIWsmQf6cbwRyeGVpiJl Jg== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx08-00178001.pphosted.com with ESMTP id 2uv1pa71jw-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:53:41 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id AB2D324 for ; Mon, 9 Sep 2019 15:53:38 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id EADF22BDA70 for ; Mon, 9 Sep 2019 17:53:37 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:53:37 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 24/24] [ARM] FDPIC: Handle arm*-*-uclinuxfdpiceabi in libstdc++ configure scripts Date: Mon, 9 Sep 2019 17:45:06 +0200 Message-ID: <20190909154526.11630-25-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon 2019-XX-XX Christophe Lyon libstdc++-v3/ * acinclude.m4: Handle uclinux*. * configure: Regenerate. * configure.host: Handle uclinux* Change-Id: Ia1b53693625e4153a090fcfc925a4d605bc98e59 diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index bc9095f..ad2cb01 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -1441,6 +1441,9 @@ AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME], [ ac_has_nanosleep=yes ac_has_sched_yield=yes ;; + uclinux*) + ac_has_nanosleep=yes + ac_has_sched_yield=yes esac elif test x"$enable_libstdcxx_time" != x"no"; then @@ -1526,7 +1529,7 @@ AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME], [ if test x"$ac_has_clock_monotonic" != x"yes"; then case ${target_os} in - linux*) + linux* | uclinux*) AC_MSG_CHECKING([for clock_gettime syscall]) AC_TRY_COMPILE( [#include @@ -4424,7 +4427,7 @@ AC_DEFUN([GLIBCXX_ENABLE_FILESYSTEM_TS], [ freebsd*|netbsd*|openbsd*|dragonfly*|darwin*) enable_libstdcxx_filesystem_ts=yes ;; - gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) + gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*) enable_libstdcxx_filesystem_ts=yes ;; rtems*) @@ -4606,7 +4609,7 @@ dnl AC_MSG_CHECKING([for sendfile that can copy files]) AC_CACHE_VAL(glibcxx_cv_sendfile, [dnl case "${target_os}" in - gnu* | linux* | solaris*) + gnu* | linux* | solaris* | uclinux*) GCC_TRY_COMPILE_OR_LINK( [#include ], [sendfile(1, 2, (off_t*)0, sizeof 1);], diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 4e714e5..c63789c 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -6652,7 +6652,7 @@ irix5* | irix6* | nonstopux*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) lt_cv_deplibs_check_method=pass_all ;; @@ -9598,7 +9598,7 @@ _LT_EOF archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in @@ -11138,7 +11138,12 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) + +# uclinux* changes (here and below) have been submitted to the libtool +# project, but have not yet been accepted: they are GCC-local changes +# for the time being. (See +# https://lists.gnu.org/archive/html/libtool-patches/2018-05/msg00000.html) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) version_type=linux need_lib_prefix=no need_version=no @@ -14822,7 +14827,12 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) + +# uclinux* changes (here and below) have been submitted to the libtool +# project, but have not yet been accepted: they are GCC-local changes +# for the time being. (See +# https://lists.gnu.org/archive/html/libtool-patches/2018-05/msg00000.html) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) version_type=linux need_lib_prefix=no need_version=no @@ -20899,6 +20909,9 @@ $as_echo "$glibcxx_glibc217" >&6; } ac_has_nanosleep=yes ac_has_sched_yield=yes ;; + uclinux*) + ac_has_nanosleep=yes + ac_has_sched_yield=yes esac elif test x"$enable_libstdcxx_time" != x"no"; then @@ -21347,7 +21360,7 @@ $as_echo "$ac_has_nanosleep" >&6; } if test x"$ac_has_clock_monotonic" != x"yes"; then case ${target_os} in - linux*) + linux* | uclinux*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime syscall" >&5 $as_echo_n "checking for clock_gettime syscall... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28316,7 +28329,7 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : chktls_save_LDFLAGS="$LDFLAGS" case $host in - *-*-linux*) + *-*-linux* | -*-uclinuxfdpic*) LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS" ;; esac @@ -47824,7 +47837,7 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : chktls_save_LDFLAGS="$LDFLAGS" case $host in - *-*-linux*) + *-*-linux* | -*-uclinuxfdpic*) LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS" ;; esac @@ -54011,7 +54024,7 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : chktls_save_LDFLAGS="$LDFLAGS" case $host in - *-*-linux*) + *-*-linux* | -*-uclinuxfdpic*) LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS" ;; esac @@ -72654,7 +72667,7 @@ fi case "$target" in - *-linux*) + *-linux* | *-uclinux*) case "$enable_linux_futex" in default) # If headers don't have gettid/futex syscalls definition, then @@ -74326,7 +74339,7 @@ $as_echo_n "checking whether to build Filesystem TS support... " >&6; } freebsd*|netbsd*|openbsd*|dragonfly*|darwin*) enable_libstdcxx_filesystem_ts=yes ;; - gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) + gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*) enable_libstdcxx_filesystem_ts=yes ;; rtems*) @@ -74878,7 +74891,7 @@ $as_echo_n "checking for sendfile that can copy files... " >&6; } $as_echo_n "(cached) " >&6 else case "${target_os}" in - gnu* | linux* | solaris*) + gnu* | linux* | solaris* | uclinux*) if test x$gcc_no_link = xyes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host index 57e1c50..898db37 100644 --- a/libstdc++-v3/configure.host +++ b/libstdc++-v3/configure.host @@ -264,7 +264,7 @@ case "${host_os}" in linux-musl*) os_include_dir="os/generic" ;; - gnu* | linux* | kfreebsd*-gnu) + gnu* | linux* | kfreebsd*-gnu | uclinux*) if [ "$uclibc" = "yes" ]; then os_include_dir="os/uclibc" elif [ "$bionic" = "yes" ]; then @@ -321,7 +321,7 @@ esac # Set any OS-dependent and CPU-dependent bits. # THIS TABLE IS SORTED. KEEP IT THAT WAY. case "${host}" in - *-*-linux*) + *-*-linux* | *-*-uclinux*) case "${host_cpu}" in i[567]86) abi_baseline_pair=i486-linux-gnu @@ -355,7 +355,7 @@ case "${host}" in fi esac case "${host}" in - arm*-*-linux-*) + arm*-*-linux-* | arm*-*-uclinuxfdpiceabi) port_specific_symbol_files="\$(srcdir)/../config/os/gnu-linux/arm-eabi-extra.ver" ;; esac