This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

[PATCH] PR 18760


-gfull and -gused are Darwin specific command line options.

They are used to enable/disable -feliminate-unused-debug-symbols. It turned out to be not a good idea to eat these command line options using "%<" spec-string construct (after inserting appropriate -fblah..). Because, whenever spec string is processed again, they do not trigger substitution operation as expected. For example when multiple source files are specified on single command line.

This patch fixes this problem by translating these options through TARGET_OPTION_TRANSLATE_TABLE.

2004-12-1 Devang Patel <dpatel@apple.com>

* config/darwin.h (TARGET_OPTION_TRANSLATE_TABLE): Add -gfull and -gused.
* config/rs6000/darwin.h (CC1_SPEC): Do not handle -gfull and -gused.
* config/i386/darwin.h (CC1_SPEC): Same.


Bootstrapped and tested on powerpc-darwin.
OK ?
-
Devang

Index: gcc/config/darwin.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/darwin.h,v
retrieving revision 1.107
diff -Idpatel.pbxuser -c -3 -p -r1.107 darwin.h
*** gcc/config/darwin.h 23 Nov 2004 01:17:55 -0000      1.107
--- gcc/config/darwin.h 2 Dec 2004 01:07:39 -0000
*************** Boston, MA 02111-1307, USA.  */
*** 116,121 ****
--- 116,123 ----
    { "-dynamic", "-Zdynamic" },  \
    { "-dynamiclib", "-Zdynamiclib" },  \
    { "-exported_symbols_list", "-Zexported_symbols_list" },  \
+   { "-gfull", "-g -fno-eliminate-unused-debug-symbols" }, \
+   { "-gused", "-g -feliminate-unused-debug-symbols" }, \
    { "-segaddr", "-Zsegaddr" }, \
    { "-segs_read_only_addr", "-Zsegs_read_only_addr" }, \
    { "-segs_read_write_addr", "-Zsegs_read_write_addr" }, \
Index: gcc/config/i386/darwin.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/darwin.h,v
retrieving revision 1.22
diff -Idpatel.pbxuser -c -3 -p -r1.22 darwin.h
*** gcc/config/i386/darwin.h    30 Oct 2004 02:48:49 -0000      1.22
--- gcc/config/i386/darwin.h    2 Dec 2004 01:07:39 -0000
*************** Boston, MA 02111-1307, USA.  */
*** 40,48 ****

  #undef CC1_SPEC
  #define CC1_SPEC "%{!static:-fPIC}\
!   %{gused: -g -feliminate-unused-debug-symbols %<gused }\
!   %{gfull: -g -fno-eliminate-unused-debug-symbols %<gfull }\
!   %{g: %{!gfull: -feliminate-unused-debug-symbols %<gfull }}"

  #undef ASM_SPEC
  #define ASM_SPEC "-arch i686 -force_cpusubtype_ALL"
--- 40,46 ----

#undef CC1_SPEC
#define CC1_SPEC "%{!static:-fPIC}\
! %{g: %{!fno-eliminate-unused-debug-symbols: -feliminate-unused-debug-symbols }}"


#undef ASM_SPEC
#define ASM_SPEC "-arch i686 -force_cpusubtype_ALL"
Index: gcc/config/rs6000/darwin.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/darwin.h,v
retrieving revision 1.70
diff -Idpatel.pbxuser -c -3 -p -r1.70 darwin.h
*** gcc/config/rs6000/darwin.h 13 Nov 2004 01:25:36 -0000 1.70
--- gcc/config/rs6000/darwin.h 2 Dec 2004 01:07:40 -0000
*************** do { \
*** 126,134 ****
the kernel or some such. */


#define CC1_SPEC "\
! %{gused: -g -feliminate-unused-debug-symbols %<gused }\
! %{gfull: -g -fno-eliminate-unused-debug-symbols %<gfull }\
! %{g: %{!gfull: -feliminate-unused-debug-symbols %<gfull }}\
%{static: %{Zdynamic: %e conflicting code gen style switches are used}}\
%{!static:%{!mdynamic-no-pic:-fPIC}}"


--- 126,132 ----
     the kernel or some such.  */

#define CC1_SPEC "\
! %{g: %{!fno-eliminate-unused-debug-symbols: -feliminate-unused-debug-symbols }} \
%{static: %{Zdynamic: %e conflicting code gen style switches are used}}\
%{!static:%{!mdynamic-no-pic:-fPIC}}"



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