public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/64499] New: -gsplit-dwarf splits objcopy argument at spaces in file path
@ 2015-01-05 13:17 jlegg at feralinteractive dot com
  2022-01-01  7:40 ` [Bug driver/64499] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: jlegg at feralinteractive dot com @ 2015-01-05 13:17 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64499

            Bug ID: 64499
           Summary: -gsplit-dwarf splits objcopy argument at spaces in
                    file path
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jlegg at feralinteractive dot com

If using -gsplit-dwarf and outputting an object file in a path containing
spaces, objcopy is invoked to copy the debug symbols to a dwo file, however the
dwo file path is split into multiple arguments at the spaces.

Here is a minimal test case that compiles an empty file:
$ gcc -v -gsplit-dwarf -x c -c /dev/null -o "o .o"
Using built-in specs.
COLLECT_GCC=gcc
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla
--enable-bootstrap --enable-shared --enable-threads=posix
--enable-checking=release --enable-multilib --with-system-zlib
--enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object
--enable-linker-build-id --with-linker-hash-style=gnu
--enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --enable-plugin
--enable-initfini-array --disable-libgcj
--with-isl=/builddir/build/BUILD/gcc-4.9.2-20141101/obj-x86_64-redhat-linux/isl-install
--with-cloog=/builddir/build/BUILD/gcc-4.9.2-20141101/obj-x86_64-redhat-linux/cloog-install
--enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686
--build=x86_64-redhat-linux
Thread model: posix
gcc version 4.9.2 20141101 (Red Hat 4.9.2-1) (GCC) 
COLLECT_GCC_OPTIONS='-v' '-gsplit-dwarf' '-c' '-o' 'o .o' '-mtune=generic'
'-march=x86-64'
 /usr/libexec/gcc/x86_64-redhat-linux/4.9.2/cc1 -quiet -v /dev/null -quiet
-dumpbase null -mtune=generic -march=x86-64 -auxbase-strip o .o -gsplit-dwarf
-version -o /tmp/ccUMU7DF.s
GNU C (GCC) version 4.9.2 20141101 (Red Hat 4.9.2-1) (x86_64-redhat-linux)
    compiled by GNU C version 4.9.2 20141101 (Red Hat 4.9.2-1), GMP version
6.0.0, MPFR version 3.1.2, MPC version 1.0.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-redhat-linux/4.9.2/include-fixed"
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-redhat-linux/4.9.2/../../../../x86_64-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-redhat-linux/4.9.2/include
 /usr/local/include
 /usr/include
End of search list.
GNU C (GCC) version 4.9.2 20141101 (Red Hat 4.9.2-1) (x86_64-redhat-linux)
    compiled by GNU C version 4.9.2 20141101 (Red Hat 4.9.2-1), GMP version
6.0.0, MPFR version 3.1.2, MPC version 1.0.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 03cfec3867418ce243292e9ba51d447c
COLLECT_GCC_OPTIONS='-v' '-gsplit-dwarf' '-c' '-o' 'o .o' '-mtune=generic'
'-march=x86-64'
 as -v --64 -o o .o /tmp/ccUMU7DF.s
GNU assembler version 2.24 (x86_64-redhat-linux) using BFD version version 2.24
COLLECT_GCC_OPTIONS='-v' '-gsplit-dwarf' '-c' '-o' 'o .o' '-mtune=generic'
'-march=x86-64'
 objcopy --extract-dwo o .o o .dwo
Usage: objcopy [option(s)] in-file [out-file]
 Copies a binary file, possibly transforming it in the process
 The options are:

I've cut off the rest of objcopy's usage output.

The command line arguments to objcopy in this example are
0) /usr/bin/objcopy
1) --extract-dwo
2) o .o
3) o
4) .dwo
Arguments 3 and 4 should be one argument, o .dwo.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug driver/64499] -gsplit-dwarf splits objcopy argument at spaces in file path
  2015-01-05 13:17 [Bug other/64499] New: -gsplit-dwarf splits objcopy argument at spaces in file path jlegg at feralinteractive dot com
@ 2022-01-01  7:40 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-01-01  7:40 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64499

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The problem is in ASM_FINAL_SPEC in gcc.c:
#ifndef ASM_FINAL_SPEC
#define ASM_FINAL_SPEC \
  "%{gsplit-dwarf: \n\
       objcopy --extract-dwo \
         %{c:%{o*:%*}%{!o*:%w%b%O}}%{!c:%U%O} \
         %b.dwo \n\
       objcopy --strip-dwo \
         %{c:%{o*:%*}%{!o*:%w%b%O}}%{!c:%U%O} \
    }"
#endif


But this was changed r11-627, so it might have been fixed. I will test this in
a bit.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-01  7:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-05 13:17 [Bug other/64499] New: -gsplit-dwarf splits objcopy argument at spaces in file path jlegg at feralinteractive dot com
2022-01-01  7:40 ` [Bug driver/64499] " pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).