bug-libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: file magic regex for hppa*64*


From: Ralf Wildenhues
Subject: Re: file magic regex for hppa*64*
Date: Sat, 2 May 2009 10:49:14 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

[ <http://thread.gmane.org/gmane.comp.gnu.libtool.bugs/6777> ]

Hello Rainer, Peter, and sorry for the long delay,

* Rainer Emrich wrote on Fri, Jan 16, 2009 at 07:24:49PM CET:
> Peter Rosin schrieb:
> > Den 2009-01-16 16:20 skrev Rainer Emrich:
> >> The file magic regex for detecting PA-RISC shared objects only works for 
> >> native
> >> HP-UX file command. This prevents from using a BSD file command and from
> >> building a cross compiler from Linux to HP-UX, see
> >> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38384
> >>
> >> Please, CC me because I'm off list.

> > The new regexp is written to match both:
> > 
> > libm.2:         ELF-64 shared object file - PA-RISC 2.0 (LP64)
> > 
> > and
> > 
> > libm.2: ELF 64-bit MSB shared object, PA-RISC 2.0 (LP64) version 1, not 
> > stripped

> > I also suggest adding a backslash for the . in the PA-RISC version (the
> > backslash is also needed on the * case on the line just after the context).

> > How about this:

> >     hppa*64*)
> > -    [lt_cv_deplibs_check_method='file_magic 
> > (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
> > +    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ 
> > -][0-9][0-9](-bit MSB)?) shared object(,| file -) PA-RISC [0-9]\.[0-9]']

Not bad.

> > (However, the regexp matches a bunch of future (and past) PA-RISC
> > versions to something named ...pa20_64..., that also seems suspect. I
> > would consider changing "PA-RISC [0-9]\.[0-9]" into "PA-RISC 2\.0" if I
> > knew anything about the involved systems. Same goes for the "[0-9][0-9]"
> > part after ELF, shouldn't that be hard coded to "64" given the name
> > ...pa20_64...? But what do I know, perhaps better left as is...)

I don't think that it's necessary to tighten the regex any further, but
matching the period literally seems good.

FWIW, I can get these outputs on these systems (all the same libraries):

HP-UX 10.20, 11.23:
libnlsstubs.sl: s800 shared library -not stripped
libsnet.sl:     PA-RISC1.1 shared library -not stripped
libssl.sl:      PA-RISC2.0 shared library -not stripped
FreeBSD 6.2, RHEL 4:
libnlsstubs.sl: PA-RISC1.0 shared library - not stripped
libsnet.sl:     PA-RISC1.1 shared library - not stripped
libssl.sl:      PA-RISC2.0 shared library - not stripped

OK to use the patch below (and add Rainer to THANKS)?

Thanks,
Ralf

    Fix cross compilation for HPPA/64 with a BSD file command.
    
    * libltdl/m4/libtool.m4 (_LT_CHECK_MAGIC_METHOD)
    [hpux10.20*, hpux11*, !ia64] <lt_cv_deplibs_check_method>:
    Match the dot in `PA-RISC 2.0' literally.  Adjust hppa*64*
    pattern to also match BSD `file' output, used in cross
    compilation setups.
    * THANKS: Update.
    Report and initial patch by Rainer Emrich, refined by Peter Rosin.

diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index 3d7a708..3e3358e 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -2986,11 +2986,11 @@ hpux10.20* | hpux11*)
     lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
     ;;
   hppa*64*)
-    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) 
shared object file - PA-RISC [0-9].[0-9]']
+    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ 
-][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC 
[0-9]\.[0-9]']
     lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
     ;;
   *)
-    lt_cv_deplibs_check_method='file_magic 
(s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
+    lt_cv_deplibs_check_method='file_magic 
(s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
     lt_cv_file_magic_test_file=/usr/lib/libc.sl
     ;;
   esac




reply via email to

[Prev in Thread] Current Thread [Next in Thread]