This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Don't pass -m64 to libcc1 on aarch64-linux.


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7045b1ca73b8c0cb12d1158f3bc59d251dca0fa5

commit 7045b1ca73b8c0cb12d1158f3bc59d251dca0fa5
Author: Yao Qi <yao.qi@linaro.org>
Date:   Wed Jan 17 12:48:52 2018 +0000

    Don't pass -m64 to libcc1 on aarch64-linux.
    
    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  <yao.qi@linaro.org>
    
    	* aarch64-linux-tdep.c (aarch64_linux_gcc_target_options): New
    	function.
    	(aarch64_linux_init_abi): Install it to gdbarch hook
    	gcc_target_options.

Diff:
---
 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  <yao.qi@linaro.org>
+
+	* 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  <palves@redhat.com>
 
 	* 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]