From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17281 invoked by alias); 15 Jun 2011 16:06:20 -0000 Received: (qmail 17270 invoked by uid 22791); 15 Jun 2011 16:06:17 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-qw0-f47.google.com (HELO mail-qw0-f47.google.com) (209.85.216.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 15 Jun 2011 16:06:04 +0000 Received: by qwh5 with SMTP id 5so300432qwh.20 for ; Wed, 15 Jun 2011 09:06:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.69.7 with SMTP id x7mr643347qai.15.1308153962986; Wed, 15 Jun 2011 09:06:02 -0700 (PDT) Received: by 10.224.45.69 with HTTP; Wed, 15 Jun 2011 09:06:02 -0700 (PDT) In-Reply-To: References: Date: Wed, 15 Jun 2011 16:33:00 -0000 Message-ID: Subject: Re: [testsuite] Run TLS torture tests with -fpic etc. From: Ramana Radhakrishnan To: Rainer Orth Cc: gcc-patches Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-06/txt/msg01166.txt.bz2 > > After it has been determined how to check for PIE support, I'm checking > this in. I haven't bisected it and not investigated failures in detail because I'm about to walk out of the door. This patch might have broken testing with arm-linux-gnueabi cross with defaults set to v7-a. ( configured with --with-arch=armv7-a --with-fpu=neon --with-float=-softfp) . The GNU ARM linker doesn't allow PIE modules where objects contain the MOVW_ABS_NC and MOVT_ABS relocations (which are actually absolute relocations) and thus we should require -fPIC / -fpic for these cases as well. This *gross* hack below allows testing to proceed atleast for tls.exp as far as arm-linux-gnueabi is concerned. What's the best way of taking this forward ? cheers Ramana 2011-06-15 Ramana Radhakrishnan * lib/wrapper.exp (target-support.exp): Load it. (${tool}_maybe_build_wrapper): Add -fPIC to the options list for testglue. diff --git a/gcc/testsuite/lib/wrapper.exp b/gcc/testsuite/lib/wrapper.exp index b7f7773..37c20f6 100644 --- a/gcc/testsuite/lib/wrapper.exp +++ b/gcc/testsuite/lib/wrapper.exp @@ -20,7 +20,7 @@ # needs it. FILENAME is the path to the wrapper file. If there are # additional arguments, they are command-line options to provide to # the compiler when compiling FILENAME. - +load_lib target-supports.exp proc ${tool}_maybe_build_wrapper { filename args } { global gluefile wrap_flags @@ -30,6 +30,9 @@ proc ${tool}_maybe_build_wrapper { filename args } { set_ld_library_path_env_vars set saved_wrap_compile_flags [target_info wrap_compile_flags] set flags [join $args " "] + if { [check_effective_target_fpic] } then { + lappend flags "-fPIC" + } # The wrapper code may contain code that gcc objects on. This # became true for dejagnu-1.4.4. The set of warnings and code # that gcc objects on may change, so just make sure -w is always