Re: Glibc ldd needs /bin/bash

2007-03-23 Thread Bruce Dubbs
Dan Nicholson wrote:
 On 3/14/07, Bruce Dubbs [EMAIL PROTECTED] wrote:
 Matthew Burgess wrote:

 How about:

 The commandldd/command shell script contains Bash-specific syntax.
 Change its shebang line to force the script to be interpreted by Bash in 
 case
 other shells (see link href=whateverBLFS/link) are installed and 
 linked
 to filename class=symlink/bin/sh/filename later:
 I don't particularly like using the word 'shebang' in the book.  It's
 slang and I think the book is a bit more formal than that.
 Unfortunately I don't really have a suggestion for a replacement that I
 really like.  How about:

 Change its invocation (shebang) line to ...
 
 I'm going ahead with this now with my preferred default program
 interpreter. Anyone can feel free to change this that doesn't work
 for them.

What's a program interpreter?

I'd prefer default shell.

  -- Bruce
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page


Re: Glibc ldd needs /bin/bash

2007-03-23 Thread Dan Nicholson
On 3/23/07, Bruce Dubbs [EMAIL PROTECTED] wrote:
 
  I'm going ahead with this now with my preferred default program
  interpreter. Anyone can feel free to change this that doesn't work
  for them.

 What's a program interpreter?

 I'd prefer default shell.

When you set the shebang line, you're describing what program will
interpret the file. It doesn't have to be a shell. It could be perl,
python, awk, env, etc. We can use something besides program
interpreter, but I don't think default shell is accurate for what
we're doing.

http://en.wikipedia.org/wiki/Shebang_(Unix)

--
Dan
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page


Re: Glibc ldd needs /bin/bash

2007-03-23 Thread Randy McMurchy
Bruce Dubbs wrote these words on 03/23/07 19:01 CST:

 What's a program interpreter?
 
 I'd prefer default shell.

Hopefully, Bruce is just joking. :-)  I've been using the term since back
in the days I was using a Tandy color computer with a 'basic' program
interpreter cartridge plugged in.

The shebang line doesn't have to be a shell. It can be any program
that interprets the following lines in the file. Hence, 'program
interpreter'.

-- 
Randy

rmlscsi: [bogomips 1003.28] [GNU ld version 2.16.1] [gcc (GCC) 4.0.3]
[GNU C Library stable release version 2.3.6] [Linux 2.6.14.3 i686]
19:06:00 up 14 days, 17:05, 1 user, load average: 1.11, 0.95, 0.47
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page


Re: Glibc ldd needs /bin/bash

2007-03-23 Thread Bruce Dubbs
Randy McMurchy wrote:
 Bruce Dubbs wrote these words on 03/23/07 19:01 CST:
 
 What's a program interpreter?

 I'd prefer default shell.
 
 Hopefully, Bruce is just joking. :-)  I've been using the term since back
 in the days I was using a Tandy color computer with a 'basic' program
 interpreter cartridge plugged in.
 
 The shebang line doesn't have to be a shell. It can be any program
 that interprets the following lines in the file. Hence, 'program
 interpreter'.

Of course I was joking.  I forgot the :).  Sorry about that.

Actually, I was confused a little and thought we were discussing dash vs
bash in general and not for a specific application.  Program interpreter
is fine in this context.

  -- Bruce


-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page


Re: Glibc ldd needs /bin/bash

2007-03-14 Thread Matthew Burgess
On Wednesday 14 March 2007 04:49, Dan Nicholson wrote:
 On 3/13/07, Matthew Burgess [EMAIL PROTECTED] wrote:
  On Monday 12 March 2007 19:44, Dan Nicholson wrote:
   So, I'm proposing that we force
   /bin/bash as the shebang for ldd. Two possible ways are:
  
   1. Prior to configure and changing dirs - sed -i 's|@BASH@|/bin/bash|'
   elf/ldd.in
 
  I like this option too.  It's easy to explain exactly what that command
  does and ensure its effects are limited to just `ldd'.

 Suggestions on the explanation welcomed for this patch.

How about:

The commandldd/command shell script contains Bash-specific syntax.  
Change its shebang line to force the script to be interpreted by Bash in case 
other shells (see link href=whateverBLFS/link) are installed and linked 
to filename class=symlink/bin/sh/filename later:

Obviously the markup will need to be fixed up a bit there, but hopefully you 
get the idea.

Regards,

Matt.
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page


Re: Glibc ldd needs /bin/bash

2007-03-14 Thread Dan Nicholson
On 3/13/07, Ag. Hatzimanikas [EMAIL PROTECTED] wrote:
 On Tue, Mar 13, at 09:49 Dan Nicholson wrote:
 
  Suggestions on the explanation welcomed for this patch.
 
 As you miiight :) have noticed by now, I am not an expert in English language
 but ...
 inadvertantly  shouldn't be inadvertently ?

I was just testing you :)

--
Dan
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page


Re: Glibc ldd needs /bin/bash

2007-03-14 Thread Bruce Dubbs
Matthew Burgess wrote:

 How about:
 
 The commandldd/command shell script contains Bash-specific syntax.  
 Change its shebang line to force the script to be interpreted by Bash in case 
 other shells (see link href=whateverBLFS/link) are installed and linked 
 to filename class=symlink/bin/sh/filename later:

I don't particularly like using the word 'shebang' in the book.  It's
slang and I think the book is a bit more formal than that.
Unfortunately I don't really have a suggestion for a replacement that I
really like.  How about:

Change its invocation (shebang) line to ...

  -- Bruce
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page


Re: Glibc ldd needs /bin/bash

2007-03-14 Thread Dan Nicholson
On 3/14/07, Bruce Dubbs [EMAIL PROTECTED] wrote:
 Matthew Burgess wrote:

  How about:
 
  The commandldd/command shell script contains Bash-specific syntax.
  Change its shebang line to force the script to be interpreted by Bash in 
  case
  other shells (see link href=whateverBLFS/link) are installed and 
  linked
  to filename class=symlink/bin/sh/filename later:

 I don't particularly like using the word 'shebang' in the book.  It's
 slang and I think the book is a bit more formal than that.
 Unfortunately I don't really have a suggestion for a replacement that I
 really like.  How about:

 Change its invocation (shebang) line to ...

Setting the shebang sets the interpreter for the script, whether it be
bash, python, etc. So, you could say Change the script's default
interpreter to be Bash in case ...

--
Dan
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page


Re: Glibc ldd needs /bin/bash

2007-03-14 Thread Randy McMurchy
Bruce Dubbs wrote these words on 03/14/07 11:26 CST:

 Change its invocation (shebang) line to ...

Another suggestion: Change its program interpreter (shebang) line to ...

-- 
Randy

rmlscsi: [bogomips 1003.28] [GNU ld version 2.16.1] [gcc (GCC) 4.0.3]
[GNU C Library stable release version 2.3.6] [Linux 2.6.14.3 i686]
11:45:00 up 5 days, 9:44, 1 user, load average: 0.21, 0.12, 0.04
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page


Re: Glibc ldd needs /bin/bash

2007-03-14 Thread Matthew Burgess
On Wednesday 14 March 2007 16:45, Dan Nicholson wrote:
 On 3/14/07, Bruce Dubbs [EMAIL PROTECTED] wrote:
  Matthew Burgess wrote:
   How about:
  
   The commandldd/command shell script contains Bash-specific syntax.
   Change its shebang line to force the script to be interpreted by Bash
   in case other shells (see link href=whateverBLFS/link) are
   installed and linked to filename class=symlink/bin/sh/filename
   later:
 
  I don't particularly like using the word 'shebang' in the book.  It's
  slang and I think the book is a bit more formal than that.
  Unfortunately I don't really have a suggestion for a replacement that I
  really like.  How about:
 
  Change its invocation (shebang) line to ...

 Setting the shebang sets the interpreter for the script, whether it be
 bash, python, etc. So, you could say Change the script's default
 interpreter to be Bash in case ...

Doh! I actually had the word interpreter in there originally, then 
thought shebang might be understood more widely.  I didn't even realize it 
was a slang term!  So, yeah, I'm in favor of using interpreter or program 
interpreter instead of shebang.

Regards,

Matt.
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page


Re: Glibc ldd needs /bin/bash

2007-03-13 Thread Matthew Burgess
On Monday 12 March 2007 19:44, Dan Nicholson wrote:
 So, I'm proposing that we force
 /bin/bash as the shebang for ldd. Two possible ways are:

 1. Prior to configure and changing dirs - sed -i 's|@BASH@|/bin/bash|'
 elf/ldd.in

I like this option too.  It's easy to explain exactly what that command does 
and ensure its effects are limited to just `ldd'.

Thanks,

Matt.
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page


Re: Glibc ldd needs /bin/bash

2007-03-13 Thread Dan Nicholson

On 3/13/07, Matthew Burgess [EMAIL PROTECTED] wrote:

On Monday 12 March 2007 19:44, Dan Nicholson wrote:
 So, I'm proposing that we force
 /bin/bash as the shebang for ldd. Two possible ways are:

 1. Prior to configure and changing dirs - sed -i 's|@BASH@|/bin/bash|'
 elf/ldd.in

I like this option too.  It's easy to explain exactly what that command does
and ensure its effects are limited to just `ldd'.


Suggestions on the explanation welcomed for this patch.

--
Dan
Index: BOOK/chapter06/glibc.xml
===
--- BOOK/chapter06/glibc.xml	(revision 7962)
+++ BOOK/chapter06/glibc.xml	(working copy)
@@ -87,6 +87,14 @@
 
 screenuserinputpatch -Np1 -i ../glibc-branch_update-patch;/userinput/screen
 
+paraThe commandldd/command utility installed by Glibc is a Bash
+script that will inadvertantly call command/bin/sh/command as its
+interpreter. This can be a problem if a different shell is installed later
+as command/bin/sh/command. Force commandbash/command to be used
+with the following substitution:/para
+
+screenuserinputsed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in/userinput/screen
+
 paraThe Glibc documentation recommends building Glibc outside of the source
 directory in a dedicated build directory:/para
 
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page


Glibc ldd needs /bin/bash

2007-03-12 Thread Dan Nicholson
Following along with the POSIXification of 2007, I noticed that ldd is
a bash script and will fail silently for non-bash /bin/sh.

[12:25 PM [EMAIL PROTECTED] bash /usr/bin/ldd /lib/libc.so.6
/lib/ld-linux.so.2 (0xb7f2b000)
linux-gate.so.1 =  (0xb7f2a000)
[12:25 PM [EMAIL PROTECTED] dash /usr/bin/ldd /lib/libc.so.6
[12:26 PM [EMAIL PROTECTED] echo $?
2

The Glibc Makefile tries to be smart and substitutes in the value for
$(BASH) in elf/ldd.in. The value for BASH is figured out in configure
using the standard autoconf macro AC_PATH_PROG. It will do a PATH
search for bash unless the variable $BASH is set in the environment,
indicating that the user wants to override the location.

When we run ./configure in Ch. 6, /bin/sh is executed, which is a link
to bash. This sets BASH=/bin/sh in the environment, so that gets
recorded by AC_PATH_PROG and subsequently substituted in /usr/bin/ldd
for the shebang (run head -n1 /usr/bin/ldd). You can see this happen
if /bin/sh - bash on your system:

$ /bin/sh -c declare -p BASH
declare -- BASH=/bin/sh
$ /bin/bash -c declare -p BASH
declare -- BASH=/bin/bash

This isn't a problem if /bin/sh - bash always. But if you later
install a new sh, ldd will bomb. So, I'm proposing that we force
/bin/bash as the shebang for ldd. Two possible ways are:

1. Prior to configure and changing dirs - sed -i 's|@BASH@|/bin/bash|'
elf/ldd.in
2. Just override the var during make - make BASH=/bin/bash

What do you guys think?

--
Dan
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page


Re: Glibc ldd needs /bin/bash

2007-03-12 Thread Bryan Kadzban
Dan Nicholson wrote:
 I noticed that ldd is
 a bash script and will fail silently for non-bash /bin/sh.

And I briefly thought well, could we patch ldd to make it POSIX?

Then I saw the script itself.  Never mind.  ;-)

 So, I'm proposing that we force
 /bin/bash as the shebang for ldd. Two possible ways are:
 
 1. Prior to configure and changing dirs - sed -i 's|@BASH@|/bin/bash|'
 elf/ldd.in
 2. Just override the var during make - make BASH=/bin/bash
 
 What do you guys think?

I like 1.  I'm not sure what else in the glibc autofoo may depend on the
value that configure comes up with for $BASH; hopefully there isn't
anything, but I don't think it's safe to depend on that.  The first is
much more specific; it only targets the ldd script instead of everything
that uses $BASH.



signature.asc
Description: OpenPGP digital signature
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page


Re: Glibc ldd needs /bin/bash

2007-03-12 Thread Dan Nicholson
On 3/12/07, Bryan Kadzban [EMAIL PROTECTED] wrote:
 Dan Nicholson wrote:
  I noticed that ldd is
  a bash script and will fail silently for non-bash /bin/sh.

 And I briefly thought well, could we patch ldd to make it POSIX?

 Then I saw the script itself.  Never mind.  ;-)

Yeah, it's pretty hairy. Or, at least it has more knowledge about
ld.so than I could claim to have.

There is a target in the Makefile that seems like it tries to rewrite
the script if configure didn't detect that you have bash-2+. You can
look at the Makefile in elf/ and look for something like
sh-ldd-rewrite.

But we have bash, so I see no reason not to use it if that's what they
had in mind.

  So, I'm proposing that we force
  /bin/bash as the shebang for ldd. Two possible ways are:
 
  1. Prior to configure and changing dirs - sed -i 's|@BASH@|/bin/bash|'
  elf/ldd.in
  2. Just override the var during make - make BASH=/bin/bash
 
  What do you guys think?

 I like 1.  I'm not sure what else in the glibc autofoo may depend on the
 value that configure comes up with for $BASH; hopefully there isn't
 anything, but I don't think it's safe to depend on that.  The first is
 much more specific; it only targets the ldd script instead of everything
 that uses $BASH.

Seems like a good idea. I'll wait a bit longer to see if anyone else
wants to chime in.

--
Dan
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page