Ch5: "Locking in" glibc, Ch6: Adjusting toolchain

Edwin van Vliet cheatah at
Wed Jun 4 08:18:55 PDT 2003

Would a more accurate regular expression for sed do the job?
The regular expression isn't pretty anyway, as it uses . instead of  \.
Let me try to form a better regex:


We haven't touched the dots yet, maybe we won't have to. There must be a
better pattern than specifying the whole filename. Actually we do that
twice. I think it's possible with a single command, using backreferences.
The & is a great improvement so far.

We would currently have the following command:

sed -e 's@/lib/' \
   -e 's@/lib/' \

It must be possible to shorten this, given that both patterns start with the
same characters:

sed -e 's@/lib/ld\(\.so\.1|-linux\.so\.2\)@/stage1&@g' \

Maybe too scary still, but much less typing. And flawless. Shorter, less
flawless, but I think
we can assume there is no /lib/ or /lib/

sed -e 's@/lib/ld\(-linux\)\?\.so\.[12]@/stage1&@g' \

But this does not solve the problem of the specs-4 patch containing more
patterns than just the /lib directory. Nonetheless, those commands can be
shorter than they are now.

Unsubscribe: send email to listar at
and put 'unsubscribe lfs-dev' in the subject header of the message

More information about the lfs-dev mailing list