Message ID | CAMe9rOpT6-1rcnW7g+TB0Sy-aZY+KPDyfo=jKS=ers9YkqDm4A@mail.gmail.com |
---|---|
State | New |
Headers | show |
On 2015.02.05 at 12:57 -0800, H.J. Lu wrote: > > We should pass handle, not file, to release_input_file. > I checked it in as an obvious fix. This commit causes: % echo "int main () {}" | gcc -fuse-ld=gold -flto -x c++ - ld.gold: internal error in remove_writer, at token.h:132 collect2: error: ld returned 1 exit status
On Fri, Feb 6, 2015 at 4:56 AM, Markus Trippelsdorf <markus@trippelsdorf.de> wrote: > On 2015.02.05 at 12:57 -0800, H.J. Lu wrote: >> >> We should pass handle, not file, to release_input_file. >> I checked it in as an obvious fix. > > This commit causes: > > % echo "int main () {}" | gcc -fuse-ld=gold -flto -x c++ - > ld.gold: internal error in remove_writer, at token.h:132 > collect2: error: ld returned 1 exit status > ld.bfd closes fd without release_input_file being called and ld.gold leaks file descriptors if release_input_file isn't called. We can either fix gold: https://sourceware.org/bugzilla/show_bug.cgi?id=17896 or revert the PR lto/64837 fix.
On 2015.02.06 at 05:10 -0800, H.J. Lu wrote: > On Fri, Feb 6, 2015 at 4:56 AM, Markus Trippelsdorf > <markus@trippelsdorf.de> wrote: > > On 2015.02.05 at 12:57 -0800, H.J. Lu wrote: > >> > >> We should pass handle, not file, to release_input_file. > >> I checked it in as an obvious fix. > > > > This commit causes: > > > > % echo "int main () {}" | gcc -fuse-ld=gold -flto -x c++ - > > ld.gold: internal error in remove_writer, at token.h:132 > > collect2: error: ld returned 1 exit status > > > > ld.bfd closes fd without release_input_file being called > and ld.gold leaks file descriptors if release_input_file > isn't called. We can either fix gold: > > https://sourceware.org/bugzilla/show_bug.cgi?id=17896 > > or revert the PR lto/64837 fix. Given that LTO would be completely broken with any gold version in gcc-5, a revert seems to be the only viable option.
On Fri, Feb 6, 2015 at 5:18 AM, Markus Trippelsdorf <markus@trippelsdorf.de> wrote: > On 2015.02.06 at 05:10 -0800, H.J. Lu wrote: >> On Fri, Feb 6, 2015 at 4:56 AM, Markus Trippelsdorf >> <markus@trippelsdorf.de> wrote: >> > On 2015.02.05 at 12:57 -0800, H.J. Lu wrote: >> >> >> >> We should pass handle, not file, to release_input_file. >> >> I checked it in as an obvious fix. >> > >> > This commit causes: >> > >> > % echo "int main () {}" | gcc -fuse-ld=gold -flto -x c++ - >> > ld.gold: internal error in remove_writer, at token.h:132 >> > collect2: error: ld returned 1 exit status >> > >> >> ld.bfd closes fd without release_input_file being called >> and ld.gold leaks file descriptors if release_input_file >> isn't called. We can either fix gold: >> >> https://sourceware.org/bugzilla/show_bug.cgi?id=17896 >> >> or revert the PR lto/64837 fix. > > Given that LTO would be completely broken with any gold version in > gcc-5, a revert seems to be the only viable option. > Fine with me and reopen PR lto/64837.
On Fri, Feb 6, 2015 at 5:30 AM, H.J. Lu <hjl.tools@gmail.com> wrote: > On Fri, Feb 6, 2015 at 5:18 AM, Markus Trippelsdorf > <markus@trippelsdorf.de> wrote: >> On 2015.02.06 at 05:10 -0800, H.J. Lu wrote: >>> On Fri, Feb 6, 2015 at 4:56 AM, Markus Trippelsdorf >>> <markus@trippelsdorf.de> wrote: >>> > On 2015.02.05 at 12:57 -0800, H.J. Lu wrote: >>> >> >>> >> We should pass handle, not file, to release_input_file. >>> >> I checked it in as an obvious fix. >>> > >>> > This commit causes: >>> > >>> > % echo "int main () {}" | gcc -fuse-ld=gold -flto -x c++ - >>> > ld.gold: internal error in remove_writer, at token.h:132 >>> > collect2: error: ld returned 1 exit status >>> > >>> >>> ld.bfd closes fd without release_input_file being called >>> and ld.gold leaks file descriptors if release_input_file >>> isn't called. We can either fix gold: >>> >>> https://sourceware.org/bugzilla/show_bug.cgi?id=17896 >>> >>> or revert the PR lto/64837 fix. >> >> Given that LTO would be completely broken with any gold version in >> gcc-5, a revert seems to be the only viable option. >> > > Fine with me and reopen PR lto/64837. > Done with r220477.
Index: ChangeLog =================================================================== --- ChangeLog (revision 220455) +++ ChangeLog (working copy) @@ -1,5 +1,10 @@ 2015-02-05 H.J. Lu <hongjiu.lu@intel.com> + * lto-plugin.c (claim_file_handler): Pass handle to + release_input_file. + +2015-02-05 H.J. Lu <hongjiu.lu@intel.com> + * lto-plugin.c (claim_file_handler): Call release_input_file only if file is claimed. Index: lto-plugin.c =================================================================== --- lto-plugin.c (revision 220455) +++ lto-plugin.c (working copy) @@ -999,7 +999,7 @@ claim_file_handler (const struct ld_plug *claimed = 1; if (release_input_file) - release_input_file (file); + release_input_file (file->handle); goto cleanup;