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: Peter Rosin
Subject: Re: file magic regex for hppa*64*
Date: Fri, 16 Jan 2009 19:00:18 +0100
User-agent: Thunderbird 2.0.0.19 (Windows/20081209)

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.

If I get this right, this is the suggested patch:

Index: libtool.m4
===================================================================
--- libtool.m4  (revision 143362)
+++ libtool.m4  (working copy)
@@ -3051,7 +3051,7 @@ 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[ 
-]{1}[0-9][0-9][bit MSB-]*) shared object[, file-]* PA-RISC [0-9].[0-9]']
     lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
     ;;
   *)
Index: libjava/libltdl/acinclude.m4
*snip*
acinclude.m4 is generated, at least it is not in the libtool repo...

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


But then I'm wondering what the "{1}" is doing there? Can't it be zapped?
And the sets "[bit MSB-]" and "[, file-]" seem a bit suspect, couldn't
that be better written as "(-bit MSB)?" and "(,| file -)" instead?

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:

Index: libtool.m4
===================================================================
--- libtool.m4  (revision 143362)
+++ libtool.m4  (working copy)
@@ -3051,7 +3051,7 @@ 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 MSB)?) shared object(,| file -) PA-RISC [0-9]\.[0-9]']
     lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
     ;;
   *)

(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...)

Untested, sorry...

Cheers,
Peter




reply via email to

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