Summary: | [7 Regression] /usr/bin/gcc-{ar,nm,ranlib} segfault without arguments | ||
---|---|---|---|
Product: | gcc | Reporter: | Matthias Klose <doko> |
Component: | driver | Assignee: | Martin Liška <marxin> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | dimhen, theivorytower |
Priority: | P3 | ||
Version: | 7.1.1 | ||
Target Milestone: | 7.3 | ||
See Also: | https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80717 | ||
Host: | Target: | ||
Build: | Known to work: | 6.4.1, 8.0 | |
Known to fail: | 7.1.1 | Last reconfirmed: | 2017-08-12 00:00:00 |
Attachments: | Patch candidate |
Description
Matthias Klose
2017-08-11 19:53:27 UTC
Let me fix that. *** Bug 81991 has been marked as a duplicate of this bug. *** marxin's patch: http://gcc.gnu.org/ml/gcc-patches/2017-08/msg01116.html But this patch doesn't work while /my_bin/bin contains a symlink. (In reply to Xi Ruoyao from comment #3) > marxin's patch: > > http://gcc.gnu.org/ml/gcc-patches/2017-08/msg01116.html > > But this patch doesn't work while /my_bin/bin contains a symlink. Can you please describe your set up is more detail? (In reply to Martin Liška from comment #4) > (In reply to Xi Ruoyao from comment #3) > > marxin's patch: > > > > http://gcc.gnu.org/ml/gcc-patches/2017-08/msg01116.html > > > > But this patch doesn't work while /my_bin/bin contains a symlink. > > Can you please describe your set up is more detail? cd $BLDDIR $SRCDIR/configure && make -j$CPUNUM cd gcc for i in ar nm ranlib; do ln -sv gcc-$i $i; done export PATH=$PWD:$PATH ar (fork infinite processes) Since my BLDDIR is /home/xry111/build/gcc, and /home/xry111/build is linked to /mnt/mm1/xry111, remove_prefix failed to remove /home/xry111/build/gcc/gcc from the prefixes. If change to export PATH=$(realpath $PWD):$PATH It would be ok. (In reply to Xi Ruoyao from comment #5) > (In reply to Martin Liška from comment #4) > > (In reply to Xi Ruoyao from comment #3) > > > marxin's patch: > > > > > > http://gcc.gnu.org/ml/gcc-patches/2017-08/msg01116.html > > > > > > But this patch doesn't work while /my_bin/bin contains a symlink. > > > > Can you please describe your set up is more detail? > > cd $BLDDIR > $SRCDIR/configure && make -j$CPUNUM > cd gcc > for i in ar nm ranlib; do ln -sv gcc-$i $i; done > export PATH=$PWD:$PATH > ar > (fork infinite processes) > > Since my BLDDIR is /home/xry111/build/gcc, and /home/xry111/build is linked > to > /mnt/mm1/xry111, remove_prefix failed to remove /home/xry111/build/gcc/gcc > from > the prefixes. If change to > > export PATH=$(realpath $PWD):$PATH > > It would be ok. Huh, so many beasts out there. What can you see with following patch: diff --git a/gcc/gcc-ar.c b/gcc/gcc-ar.c index 1155ba83e35..452ca87d2ce 100644 --- a/gcc/gcc-ar.c +++ b/gcc/gcc-ar.c @@ -199,6 +199,8 @@ main (int ac, char **av) /* If the exe_name points to the wrapper, remove folder of the wrapper from prefix and try search again. */ + fprintf (stderr, "exe_name: %s, wrapper_file: %s\n", exe_name, + wrapper_file); if (strcmp (exe_name, wrapper_file) == 0) { char *exe_folder = wrapper_file; It's probably related to lrealpath that does not follow links. Btw. is your link a mount? I'm tending to remove the whole smartness of gcc-ar that removes the prefix. Martin Created attachment 42168 [details]
Patch candidate
So I eventually decided to remove the smartness in wrappers, let's make it simple. I've been testing that.
Author: marxin Date: Thu Oct 19 11:08:28 2017 New Revision: 253886 URL: https://gcc.gnu.org/viewcvs?rev=253886&root=gcc&view=rev Log: Revert r238089 (PR driver/81829). 2017-10-19 Martin Liska <mliska@suse.cz> PR driver/81829 * file-find.c (remove_prefix): Remove. * file-find.h (remove_prefix): Likewise. * gcc-ar.c: Remove smartness of lookup. Modified: trunk/gcc/ChangeLog trunk/gcc/file-find.c trunk/gcc/file-find.h trunk/gcc/gcc-ar.c Fixed on trunk, queued for backports. Author: marxin Date: Tue Nov 21 16:00:55 2017 New Revision: 255009 URL: https://gcc.gnu.org/viewcvs?rev=255009&root=gcc&view=rev Log: Backport r253886 2017-11-21 Martin Liska <mliska@suse.cz> Backport from mainline 2017-10-19 Martin Liska <mliska@suse.cz> PR driver/81829 * file-find.c (remove_prefix): Remove. * file-find.h (remove_prefix): Likewise. * gcc-ar.c: Remove smartness of lookup. Modified: branches/gcc-7-branch/gcc/ChangeLog branches/gcc-7-branch/gcc/file-find.c branches/gcc-7-branch/gcc/file-find.h branches/gcc-7-branch/gcc/gcc-ar.c Fixed. *** Bug 80717 has been marked as a duplicate of this bug. *** |