Don't run specs adjustment in place (perl -i)
jhuntwork at linuxfromscratch.org
Sun Jan 29 20:13:46 PST 2006
Dan Nicholson wrote:
> gcc -dumpspecs | \
> perl -p -e 's@/tools/lib/ld@/lib/ld at g;' \
> -e 's@\*startfile_prefix_spec:\n@$_/usr/lib/ @g;' > \
> `dirname $(gcc --print-libgcc-file-name)`/specs
I don't think so, Dan. As I said in lfs-dev, indeed the -i isn't
necessary, but it's also not hurting anything. Let's break this down.
GCC 4 doesn't have a specs file in place until we drop it there. It's
using its internal default settings. Run this on a final LFS build and
you'll see what I mean: ls -l /usr/lib/gcc/$MACHTYPE/4.0.2/specs
So before we run that command, there's nothing at `dirname $(gcc
Next, gcc -dumpspecs by itself, dumps its specs to stdout. Instead, we
pipe that output to perl. Perl is running its expression on piped input.
Lastly, we take the results of the perl command and use '>' to create a
new file with the output.
No matter how many times this command is run, (with or without -i) you
will always be creating a new file. If there wasn't the '>' there, it
might be a different story.
More information about the cross-lfs