Bug 50293 - -flto fails if GCC is installed in directory with space in path name
Summary: -flto fails if GCC is installed in directory with space in path name
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: lto (show other bugs)
Version: 4.6.1
: P3 normal
Target Milestone: 4.7.3
Assignee: Not yet assigned to anyone
URL:
Keywords: lto
Depends on:
Blocks:
 
Reported: 2011-09-05 10:50 UTC by Jon Beniston
Modified: 2013-11-10 08:11 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail: 4.6.2, 4.7.2
Last reconfirmed: 2013-03-06 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Beniston 2011-09-05 10:50:02 UTC
The majority of GCC seems to run fine if installed in a directory with spaces in the filename. However, there seems to be an issue if -flto is used in 4.6.1 that wasn't an issue in 4.5.1.

collect2 version 4.6.1 (arm/ELF)
/cygdrive/c/Program Files/gnu/bin/../lib/gcc/arm-elf/4.6.1/../../../../arm-elf/bin/ld -plugin /cygdrive/c/Program Files/gnu/bin/../libexec/gcc/arm-elf/4.6.1/cyglto_plugin-0.dll -plugin-opt=/cygdrive/c/Program Files/gnu/bin/../libexec/gcc/arm-elf/4.6.1/lto-wrapper.exe -plugin-opt=-fresolution=/tmp/ccRdw4BE.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc --relax -EL -v -L/cygdrive/c/Program Files/gnu/bin/../lib/gcc/arm-elf/4.6.1/cyclone -L/cygdrive/c/Program Files/gnu/bin/../lib/gcc/arm-elf/4.6.1/../../../../arm-elf/lib/cyclone -L/cygdrive/c/Program Files/gnu/bin/../lib/gcc/arm-elf/4.6.1 -L/cygdrive/c/Program Files/gnu/bin/../lib/gcc -L/cygdrive/c/Program Files/gnu/bin/../lib/gcc/arm-elf/4.6.1/../../../../arm-elf/lib /tmp/cciZHvSE.o -lgcc -T crt0.ld -lgcc -T cyclone.ld
/cygdrive/c/Program Files/gnu/bin/../lib/gcc/arm-elf/4.6.1/../../../../arm-elf/bin/ld: /cygdrive/c/Program: error in plugin cleanup (ignored)
/cygdrive/c/Program Files/gnu/bin/../lib/gcc/arm-elf/4.6.1/../../../../arm-elf/bin/ld: /cygdrive/c/Program: error loading plugin
collect2: ld returned 1 exit status

I tried quoting the options in the specs file, but that didn't seem to help. i.e.:

 -plugin "%(linker_plugin_file)"     -plugin-opt="%(lto_wrapper)"
Comment 1 Richard Biener 2011-09-05 11:14:08 UTC
I'm not sure the quoting will survive, it is, for example, passed to the
collect-ld script and re-issued from lto-wrapper itself.
Comment 2 Cody Schafer 2012-10-14 00:58:44 UTC
I've just run into the same issue with gcc 4.7.2 (using the binary here: http://www.makehackvoid.com/sites/default/files/MHV_AVR_Tools_20121007.exe )

Disabling LTO allows the link to complete.
Comment 3 jye2 2013-03-06 06:32:15 UTC
Author: jye2
Date: Wed Mar  6 06:32:03 2013
New Revision: 196485

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=196485
Log:
2013-03-06  Joey Ye  <joey.ye@arm.com>

    PR lto/50293
    * gcc.c (convert_white_space): New function.
    (main): Handles white space in function name.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/gcc.c
Comment 4 Georg-Johann Lay 2013-03-06 19:29:47 UTC
Thanks for the patch.  I tested it together with a --target=avr --host=i386-mingw32 --build=i686-linux-gnu canadian cross with spaces in the install pass.

Will this be backported?
Comment 5 jye2 2013-03-08 07:25:17 UTC
Author: jye2
Date: Fri Mar  8 07:25:09 2013
New Revision: 196534

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=196534
Log:
013-03-08  Joey Ye  <joey.ye@arm.com>

    Backport from mainline
    2013-03-06  Joey Ye  <joey.ye@arm.com>

    PR lto/50293
    * gcc.c (convert_white_space): New function.
    (main): Handles white space in function name.

Modified:
    branches/gcc-4_7-branch/gcc/ChangeLog
    branches/gcc-4_7-branch/gcc/gcc.c
Comment 6 Andrew Pinski 2013-11-10 08:11:56 UTC
Fixed.