From patchwork Fri Jan 19 09:17:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 25452 Received: (qmail 47411 invoked by alias); 19 Jan 2018 09:17:44 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 47350 invoked by uid 89); 19 Jan 2018 09:17:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=H*r:sk:static. X-HELO: mail-wr0-f173.google.com Received: from mail-wr0-f173.google.com (HELO mail-wr0-f173.google.com) (209.85.128.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 19 Jan 2018 09:17:38 +0000 Received: by mail-wr0-f173.google.com with SMTP id g38so934490wrd.2 for ; Fri, 19 Jan 2018 01:17:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=DQIQc+AuVKGlP4kBSlxL6VBAhwoR/D0VrYpwMmenHpM=; b=ZIZLxsVYdtTJR3MxREdFWYUDPCT02d4y3OMxdw2zR6XeSeW2f2KeHSseYHGMpP34u2 eaaf7ytvgaHaHrFNGexYmEFuUghe5tMNhCw+sXBbRG0aNnzVmbRzIrKsWybfmg9jDwvv hTWwsYyJg0fsTnTaxAs9fvzdX8eGGwd/VB2IB2Wj5SOlU8XYHM4hpGqwLLeMGBhQaSRp H5PKUlwam5NkcEA7F62xFkjy+UkGTUxgv6Q6fDEy1iGkMMze4iKG/QvNlkFQk/pofJzv XdRbf582oFsKpmMixk2Kg6sdQKTUFBPtyhYbbJJr7jyYZZtz+kSfNRQVoRnptC8qv7mK Cy9Q== X-Gm-Message-State: AKwxyte2YXEq5HIMAa617hevA7HGLpWq5ILI5qWr39hyaRxfzNbWohbI DHHyYg9dAe9+BpOgOwCOMX2uYQ== X-Google-Smtp-Source: ACJfBovg23UmOQMX0UjFybXl376kBIWEk4HlnqMlKvldWkRwL0S4corFIw6PWavsHbONeFt5Am/YYw== X-Received: by 10.223.129.67 with SMTP id 61mr8467554wrm.271.1516353456179; Fri, 19 Jan 2018 01:17:36 -0800 (PST) Received: from E107787-LIN.cambridge.arm.com (static.42.136.251.148.clients.your-server.de. [148.251.136.42]) by smtp.gmail.com with ESMTPSA id u79sm913571wma.10.2018.01.19.01.17.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 19 Jan 2018 01:17:35 -0800 (PST) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [committed] Don't pass -m32 to libcc1 on arm-linux Date: Fri, 19 Jan 2018 09:17:30 +0000 Message-Id: <1516353450-16357-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes When I run gdb.compile/ tests on arm-linux, I get the following fails, (gdb) compile code -- ;^M arm-none-linux-gnueabihf-gcc: error: unrecognized command line option '-m32'; did you mean '-mbe32'?^M Compilation failed.^M (gdb) compile code (void) param^M arm-none-linux-gnueabihf-gcc: error: unrecognized command line option '-m32'; did you mean '-mbe32'?^M Compilation failed.^M (gdb) FAIL: gdb.compile/compile-ops.exp: compile code (void) param This patch fixes it by implementing gcc_target_options gdbarch method for arm-linux to override option "-m32". gdb: 2018-01-19 Yao Qi * arm-linux-tdep.c (arm_linux_gcc_target_options): New function. (arm_linux_init_abi): Install it. --- gdb/ChangeLog | 5 +++++ gdb/arm-linux-tdep.c | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6709f44..53fde81 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2018-01-19 Yao Qi + * arm-linux-tdep.c (arm_linux_gcc_target_options): New function. + (arm_linux_init_abi): Install it. + +2018-01-19 Yao Qi + * osabi.c (gdb_osabi_names): Extend the regexp for arm-linux-gnueabihf. diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c index d1262cc..e8f8c4e 100644 --- a/gdb/arm-linux-tdep.c +++ b/gdb/arm-linux-tdep.c @@ -1712,6 +1712,15 @@ arm_linux_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc) return find_solib_trampoline_target (frame, pc); } +/* Implement the gcc_target_options gdbarch method. */ + +static char * +arm_linux_gcc_target_options (struct gdbarch *gdbarch) +{ + /* GCC doesn't know "-m32". */ + return NULL; +} + static void arm_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) @@ -1992,6 +2001,8 @@ arm_linux_init_abi (struct gdbarch_info info, arm_linux_record_tdep.arg5 = ARM_A1_REGNUM + 4; arm_linux_record_tdep.arg6 = ARM_A1_REGNUM + 5; arm_linux_record_tdep.arg7 = ARM_A1_REGNUM + 6; + + set_gdbarch_gcc_target_options (gdbarch, arm_linux_gcc_target_options); } void