From patchwork Wed Jan 17 12:51:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 25427 Received: (qmail 111273 invoked by alias); 17 Jan 2018 12:51:27 -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 111261 invoked by uid 89); 17 Jan 2018 12:51:26 -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=10016, nowadays, H*r:sk:static. X-HELO: mail-wr0-f172.google.com Received: from mail-wr0-f172.google.com (HELO mail-wr0-f172.google.com) (209.85.128.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 17 Jan 2018 12:51:25 +0000 Received: by mail-wr0-f172.google.com with SMTP id 100so18688105wrb.7 for ; Wed, 17 Jan 2018 04:51:25 -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=LZOmAld561c0Qpj4lWOv66B5l1oXzrRnAKYoEwnaXj4=; b=lnbYV6Ao9kJZFyXsHSfpnD15+1cyrZxLo3RiBxV2JygjHRMW6tL9rOuJaeQWRTq6Ww yMp+XFk2EWn4KkBw46roZYJxPKcdR+9RsbBFYvWQzpB9TTTnPY1rkSQbcVGwJwFeAS8Y mgakw1UcBIJHnQigxg/HLVQ6hI8vpoHCMakKZoxmyYmoVJFOOh60ZGBp1gJQK7IXQb98 aUxPBtfaGoG4z9ITW+miwW/u1nfl80JxCvhU8nkoq7mGqwvkl4FU1DZk0DMPf16qmIGH pg1TZehE4WNZTqYbV0QLT6fvkAH1e0e48w1xOTrR1hlDRPB9UOB0/om4rLpUGBZF06Ja YBwA== X-Gm-Message-State: AKwxytccNsrPyzKYrjxNiUwCNbvOEK3Rn78bdgLWYKEz5mDd3O8dpou0 mMUL8UK/JYzeNctAtjP6QzUBwA== X-Google-Smtp-Source: ACJfBotWKK6w3ab0/spHg+T/tZ8iJQ6zA0xydiB4zmuia+gS5SIytfU1vDAoRZYU4fV90fjANogIXg== X-Received: by 10.223.155.131 with SMTP id d3mr2479073wrc.134.1516193482902; Wed, 17 Jan 2018 04:51:22 -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 v191sm3446116wmf.25.2018.01.17.04.51.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 17 Jan 2018 04:51:22 -0800 (PST) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [committed master/8.1] Don't pass -m64 to libcc1 on aarch64-linux. Date: Wed, 17 Jan 2018 12:51:18 +0000 Message-Id: <1516193478-17697-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes Nowadays, if we use "compile" on aarch64-linux, we'll get the following error, (gdb) compile code -- ; aarch64-none-linux-gnu-gcc: error: unrecognized command line option '-m64' because the default gcc_target_options returns "-m64" and "-mcmodel=large", neither is useful to aarch64-linux. gdb: 2018-01-17 Yao Qi * aarch64-linux-tdep.c (aarch64_linux_gcc_target_options): New function. (aarch64_linux_init_abi): Install it to gdbarch hook gcc_target_options. --- gdb/ChangeLog | 7 +++++++ gdb/aarch64-linux-tdep.c | 11 +++++++++++ 2 files changed, 18 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c831a5c..a798d06 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2018-01-17 Yao Qi + + * aarch64-linux-tdep.c (aarch64_linux_gcc_target_options): New + function. + (aarch64_linux_init_abi): Install it to gdbarch hook + gcc_target_options. + 2018-01-15 Pedro Alves * common/signals-state-save-restore.c diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c index 1a82406..1f3e888 100644 --- a/gdb/aarch64-linux-tdep.c +++ b/gdb/aarch64-linux-tdep.c @@ -1001,6 +1001,15 @@ aarch64_linux_syscall_record (struct regcache *regcache, return 0; } +/* Implement the "gcc_target_options" gdbarch method. */ + +static char * +aarch64_linux_gcc_target_options (struct gdbarch *gdbarch) +{ + /* GCC doesn't know "-m64". */ + return NULL; +} + static void aarch64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { @@ -1225,6 +1234,8 @@ aarch64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_displaced_step_location (gdbarch, linux_displaced_step_location); set_gdbarch_displaced_step_hw_singlestep (gdbarch, aarch64_displaced_step_hw_singlestep); + + set_gdbarch_gcc_target_options (gdbarch, aarch64_linux_gcc_target_options); } void