Bug 11060 - Fix breakage of -fplugin=libcc1plugin
Summary: Fix breakage of -fplugin=libcc1plugin
Status: CLOSED FIXED
Alias: None
Product: ccache
Classification: Unclassified
Component: ccache (show other bugs)
Version: 3.2.1
Hardware: All Linux
: P5 normal
Target Milestone: 3.2.2
Assignee: Joel Rosdahl
QA Contact: Joel Rosdahl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-16 23:02 UTC by Jan Kratochvil
Modified: 2015-05-10 12:32 UTC (History)
0 users

See Also:


Attachments
Fix. (607 bytes, patch)
2015-01-16 23:02 UTC, Jan Kratochvil
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Kratochvil 2015-01-16 23:02:10 UTC
Created attachment 10628 [details]
Fix.

GDB-7.9 and GCC-5.0 contain instant code compilation feature:
  https://sourceware.org/gdb/wiki/GCCCompileAndExecute

GDB calls gcc in a way like:
  x86_64-redhat-linux-gcc -m64 -mcmodel=large -std=gnu11 -fno-exceptions -O0 -gdwarf-4 -fPIC -w -fno-stack-protector -fplugin=libcc1plugin -fplugin-arg-libcc1plugin-fd=8 /tmp/gdbobj-SBkCR2/out1.c -c -o /tmp/gdbobj-SBkCR2/out1.o

And GDB then communicates with child GCC over fd 8 (in this case).

With ccache the command hangs.  IMO it hans because it runs the command twice and so after all the communication with GDB completes second GCC tries to communicate again - which cannot work.

------------------------------------------------------------------------------
Command line: x86_64-redhat-linux-gcc -m64 -mcmodel=large -std=gnu11 -fno-exceptions -O0 -gdwarf-4 -fPIC -w -fno-stack-protector -fplugin=libcc1plugin -fplugin-arg-libcc1plugin-fd=8 /tmp/gdbobj-mhxyIe/out1.c -c -o /tmp/gdbobj-mhxyIe/out1.o
Hostname: host1.jankratochvil.net
Working directory: /home/jkratoch/redhat/gdb-clean/gdb/testsuite
Source file: /tmp/gdbobj-mhxyIe/out1.c
Object file: /tmp/gdbobj-mhxyIe/out1.o
Trying direct lookup
Looking for object file hash in /home/jkratoch/.ccache/8/f/ffd320700a68c954a27813482a8236-36287.manifest
No such manifest file
Did not find object file hash in manifest
Running preprocessor
Executing /usr/bin/x86_64-redhat-linux-gcc -m64 -mcmodel=large -std=gnu11 -fno-exceptions -O0 -gdwarf-4 -fPIC -w -fno-stack-protector -fplugin=libcc1plugin -fplugin-arg-libcc1plugin-fd=8 -E /tmp/gdbobj-mhxyIe/out1.c
Failed to stat include file gdb command line: No such file or directory
Disabling direct mode
Got object file hash from preprocessor
Object file /home/jkratoch/.ccache/d/6/a33e6857193e3619bdf58567cd261a-29788.o not in cache
Running real compiler
Executing /usr/bin/x86_64-redhat-linux-gcc -m64 -mcmodel=large -std=gnu11 -fno-exceptions -O0 -gdwarf-4 -fPIC -w -fno-stack-protector -fplugin=libcc1plugin -fplugin-arg-libcc1plugin-fd=8 -c -o /tmp/gdbobj-mhxyIe/out1.o /home/jkratoch/.ccache/tmp/out1.stdout.host1.jankratochvil.net.9782.nBRkk6.i
<hang>
------------------------------------------------------------------------------

Attaching a fix, thanks.
Comment 1 Joel Rosdahl 2015-03-08 16:14:35 UTC
Thanks, fixed in 4f8931b4c7ea6aa7e453279857ee1425631510d2.
Comment 2 Joel Rosdahl 2015-05-10 12:32:49 UTC
Included in v3.2.2.