Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hints/freebsd.sh not freebsd 7+ aware #10338

Closed
p5pRT opened this issue Apr 21, 2010 · 18 comments
Closed

hints/freebsd.sh not freebsd 7+ aware #10338

p5pRT opened this issue Apr 21, 2010 · 18 comments

Comments

@p5pRT
Copy link

p5pRT commented Apr 21, 2010

Migrated from rt.perl.org#74564 (status was 'resolved')

Searchable as RT74564$

@p5pRT
Copy link
Author

p5pRT commented Apr 21, 2010

From @toddr

When running configure on FreeBSD 7+, the following error message is printed when hints are run​:

./hints/freebsd.sh​: /usr/bin/objformat​: not found

The reason for this is outlined in this email from Feb 2007
http​://lists.freebsd.org/pipermail/freebsd-ports/2007-February/038523.html

As hints run now, it should be executing the non-a.out code, so the below patch should be applied to fix this.

Inline Patch
diff --git a/hints/freebsd.sh b/hints/freebsd.sh
index 7d543be..cc6484b 100644
--- a/hints/freebsd.sh
+++ b/hints/freebsd.sh
@@ -114,7 +114,7 @@ case "$osvers" in
        lddlflags="-Bshareable $lddlflags"
        ;;
 
-*)
+3*|4*|5*|6*)
         objformat=`/usr/bin/objformat`
         if [ x$objformat = xaout ]; then
             if [ -e /usr/lib/aout ]; then
@@ -130,6 +130,13 @@ case "$osvers" in
         fi
         cccdlflags='-DPIC -fPIC'
         ;;
+*)
+       libpth="/usr/lib /usr/local/lib"
+       glibpth="/usr/lib /usr/local/lib"
+       ldflags="-Wl,-E "
+        lddlflags="-shared "
+        cccdlflags='-DPIC -fPIC'
+       ;;
 esac
 
 case "$osvers" in

@p5pRT
Copy link
Author

p5pRT commented Apr 21, 2010

From @toddr

patch file attached

@p5pRT
Copy link
Author

p5pRT commented Apr 21, 2010

From @toddr

Inline Patch
diff --git a/hints/freebsd.sh b/hints/freebsd.sh
index 7d543be..cc6484b 100644
--- a/hints/freebsd.sh
+++ b/hints/freebsd.sh
@@ -114,7 +114,7 @@ case "$osvers" in
 	lddlflags="-Bshareable $lddlflags"
 	;;
 
-*)
+3*|4*|5*|6*)
         objformat=`/usr/bin/objformat`
         if [ x$objformat = xaout ]; then
             if [ -e /usr/lib/aout ]; then
@@ -130,6 +130,13 @@ case "$osvers" in
         fi
         cccdlflags='-DPIC -fPIC'
         ;;
+*)
+	libpth="/usr/lib /usr/local/lib"
+	glibpth="/usr/lib /usr/local/lib"
+	ldflags="-Wl,-E "
+        lddlflags="-shared "
+        cccdlflags='-DPIC -fPIC'
+	;;
 esac
 
 case "$osvers" in

@p5pRT
Copy link
Author

p5pRT commented Apr 21, 2010

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Apr 22, 2010

From @doughera88

On Wed, 21 Apr 2010, Todd Rinaldo wrote​:

# New Ticket Created by Todd Rinaldo
# Please include the string​: [perl #74564]
# in the subject line of all future correspondence about this issue.
# <URL​: http​://rt.perl.org/rt3/Ticket/Display.html?id=74564 >

When running configure on FreeBSD 7+, the following error message is printed when hints are run​:

./hints/freebsd.sh​: /usr/bin/objformat​: not found

The reason for this is outlined in this email from Feb 2007
http​://lists.freebsd.org/pipermail/freebsd-ports/2007-February/038523.html

As hints run now, it should be executing the non-a.out code, so the below patch should be applied to fix this.

Thanks. Applied as commit a8ca765

--
  Andy Dougherty doughera@​lafayette.edu

@p5pRT
Copy link
Author

p5pRT commented Apr 22, 2010

@doughera88 - Status changed from 'open' to 'resolved'

@p5pRT p5pRT closed this as completed Apr 22, 2010
@p5pRT
Copy link
Author

p5pRT commented Apr 22, 2010

From @Tux

On Thu, 22 Apr 2010 08​:38​:35 -0400 (EDT), Andy Dougherty
<doughera@​lafayette.edu> wrote​:

On Wed, 21 Apr 2010, Todd Rinaldo wrote​:

# New Ticket Created by Todd Rinaldo
# Please include the string​: [perl #74564]
# in the subject line of all future correspondence about this issue.
# <URL​: http​://rt.perl.org/rt3/Ticket/Display.html?id=74564 >

When running configure on FreeBSD 7+, the following error message is printed when hints are run​:

./hints/freebsd.sh​: /usr/bin/objformat​: not found

The reason for this is outlined in this email from Feb 2007
http​://lists.freebsd.org/pipermail/freebsd-ports/2007-February/038523.html

As hints run now, it should be executing the non-a.out code, so the below patch should be applied to fix this.

Thanks. Applied as commit a8ca765

+1 for 5.12.1

--
H.Merijn Brand http​://tux.nl Perl Monger http​://amsterdam.pm.org/
using 5.00307 through 5.12 and porting perl5.13.x on HP-UX 10.20, 11.00,
11.11, 11.23, and 11.31, OpenSuSE 10.3, 11.0, and 11.1, AIX 5.2 and 5.3.
http​://mirrors.develooper.com/hpux/ http​://www.test-smoke.org/
http​://qa.perl.org http​://www.goldmark.org/jeff/stupid-disclaimers/

@p5pRT
Copy link
Author

p5pRT commented Apr 22, 2010

From @doughera88

On Thu, 22 Apr 2010, H.Merijn Brand wrote​:

On Thu, 22 Apr 2010 08​:38​:35 -0400 (EDT), Andy Dougherty
<doughera@​lafayette.edu> wrote​:

On Wed, 21 Apr 2010, Todd Rinaldo wrote​:

# New Ticket Created by Todd Rinaldo
# Please include the string​: [perl #74564]
# in the subject line of all future correspondence about this issue.
# <URL​: http​://rt.perl.org/rt3/Ticket/Display.html?id=74564 >

When running configure on FreeBSD 7+, the following error message is printed when hints are run​:

./hints/freebsd.sh​: /usr/bin/objformat​: not found

The reason for this is outlined in this email from Feb 2007
http​://lists.freebsd.org/pipermail/freebsd-ports/2007-February/038523.html

As hints run now, it should be executing the non-a.out code, so the below patch should be applied to fix this.

Thanks. Applied as commit a8ca765

+1 for 5.12.1

I don't really care either way. It's a quite safe fix, but the warning it
silences was a harmless warning too. (The hints already had the correct
forward-thinking fallback.)

--
  Andy Dougherty doughera@​lafayette.edu

@p5pRT
Copy link
Author

p5pRT commented Apr 27, 2010

From @doughera88

On Thu, 22 Apr 2010, Andy Dougherty wrote​:

On Thu, 22 Apr 2010, H.Merijn Brand wrote​:

On Thu, 22 Apr 2010 08​:38​:35 -0400 (EDT), Andy Dougherty
<doughera@​lafayette.edu> wrote​:

On Wed, 21 Apr 2010, Todd Rinaldo wrote​:

# New Ticket Created by Todd Rinaldo
# Please include the string​: [perl #74564]
# in the subject line of all future correspondence about this issue.
# <URL​: http​://rt.perl.org/rt3/Ticket/Display.html?id=74564 >

When running configure on FreeBSD 7+, the following error message is printed when hints are run​:

./hints/freebsd.sh​: /usr/bin/objformat​: not found

The reason for this is outlined in this email from Feb 2007
http​://lists.freebsd.org/pipermail/freebsd-ports/2007-February/038523.html

As hints run now, it should be executing the non-a.out code, so the below patch should be applied to fix this.

Thanks. Applied as commit a8ca765

+1 for 5.12.1

I don't really care either way. It's a quite safe fix, but the warning it
silences was a harmless warning too. (The hints already had the correct
forward-thinking fallback.)

On further thought, I'll vote +1 for 5.12.1 here -- it's probably easier
in the long run if the hints files don't drift apart, much like we try
not to let Configure drift.

--
  Andy Dougherty doughera@​lafayette.edu

@p5pRT
Copy link
Author

p5pRT commented Apr 27, 2010

From @toddr

On Apr 27, 2010, at 7​:11 AM, Andy Dougherty wrote​:

On Thu, 22 Apr 2010, Andy Dougherty wrote​:

On Thu, 22 Apr 2010, H.Merijn Brand wrote​:

On Thu, 22 Apr 2010 08​:38​:35 -0400 (EDT), Andy Dougherty
<doughera@​lafayette.edu> wrote​:

On Wed, 21 Apr 2010, Todd Rinaldo wrote​:

# New Ticket Created by Todd Rinaldo
# Please include the string​: [perl #74564]
# in the subject line of all future correspondence about this issue.
# <URL​: http​://rt.perl.org/rt3/Ticket/Display.html?id=74564 >

When running configure on FreeBSD 7+, the following error message is printed when hints are run​:

./hints/freebsd.sh​: /usr/bin/objformat​: not found

The reason for this is outlined in this email from Feb 2007
http​://lists.freebsd.org/pipermail/freebsd-ports/2007-February/038523.html

As hints run now, it should be executing the non-a.out code, so the below patch should be applied to fix this.

Thanks. Applied as commit a8ca765

+1 for 5.12.1

I don't really care either way. It's a quite safe fix, but the warning it
silences was a harmless warning too. (The hints already had the correct
forward-thinking fallback.)

On further thought, I'll vote +1 for 5.12.1 here -- it's probably easier
in the long run if the hints files don't drift apart, much like we try
not to let Configure drift.

While we're at it, I've discovered that ports is also applying this patch to perl for 5.10. Since this hints file is arguably the property of the ports folks, I'd argue for it being committed into blead. Same drift argument.

I've amended the ports patch to deal with the recent blead changes to this file only. From what I can tell, the patch forces threads on and also makes some library inclusion changes. I assume 5.12 didn't have any significant library dependency issues that would make this patch invalid. The only thing I'm unsure about is whether we should be forcing threads on the way they're doing it.

I don't have any strong feelings either way if this goes into 5.12.1 but it probably ought to go into blead.

Todd.

@p5pRT
Copy link
Author

p5pRT commented Apr 27, 2010

From @Tux

On Tue, 27 Apr 2010 11​:00​:23 -0500, Todd Rinaldo <toddr@​cpanel.net>
wrote​:

Thanks. Applied as commit a8ca765

That line shows it is in blead already

+1 for 5.12.1

That, plus my vote makes us need just one more committer vote to get it
into 5.12.1

I don't really care either way. It's a quite safe fix, but the warning it
silences was a harmless warning too. (The hints already had the correct
forward-thinking fallback.)

On further thought, I'll vote +1 for 5.12.1 here -- it's probably easier
in the long run if the hints files don't drift apart, much like we try
not to let Configure drift.

While we're at it, I've discovered that ports is also applying this
patch to perl for 5.10. Since this hints file is arguably the property
of the ports folks,

On what grounds? I didn't check, but did *all* patches to the hint file
come from the port folk?

I'd argue for it being committed into blead. Same drift argument.

I've amended the ports patch to deal with the recent blead changes to
this file only. From what I can tell, the patch forces threads on and
also makes some library inclusion changes. I assume 5.12 didn't have
any significant library dependency issues that would make this patch
invalid. The only thing I'm unsure about is whether we should be
forcing threads on the way they're doing it.

I don't have any strong feelings either way if this goes into 5.12.1
but it probably ought to go into blead.

Todd.

--
H.Merijn Brand http​://tux.nl Perl Monger http​://amsterdam.pm.org/
using 5.00307 through 5.12 and porting perl5.13.x on HP-UX 10.20, 11.00,
11.11, 11.23, and 11.31, OpenSuSE 10.3, 11.0, and 11.1, AIX 5.2 and 5.3.
http​://mirrors.develooper.com/hpux/ http​://www.test-smoke.org/
http​://qa.perl.org http​://www.goldmark.org/jeff/stupid-disclaimers/

@p5pRT
Copy link
Author

p5pRT commented Apr 27, 2010

From @toddr

On Apr 27, 2010, at 11​:43 AM, H.Merijn Brand wrote​:

Thanks. Applied as commit a8ca765
That line shows it is in blead already
I was referring to the additional patch file I just sent

While we're at it, I've discovered that ports is also applying this
patch to perl for 5.10. Since this hints file is arguably the property
of the ports folks,

On what grounds? I didn't check, but did *all* patches to the hint file
come from the port folk?

I'm making a bold assumption that a large portion of the freebsd install base installs whatever ports provides. Therefore it would be advantageous that whatever p5p provides be as close as possible to what ports provides for the hints file. I realize there are limitations in my assumptions. I was hoping some active freebsd folks could chime in with an opinion.

Todd

@p5pRT
Copy link
Author

p5pRT commented Apr 27, 2010

From @toddr

On Apr 27, 2010, at 11​:58 AM, Todd Rinaldo wrote​:

On Apr 27, 2010, at 11​:43 AM, H.Merijn Brand wrote​:

Thanks. Applied as commit a8ca765
That line shows it is in blead already
I was referring to the additional patch file I just sent

Huh. maybe I should send the patch then.

@p5pRT
Copy link
Author

p5pRT commented Apr 27, 2010

From @toddr

Inline Patch
diff --git a/hints/freebsd.sh b/hints/freebsd.sh
index 44cf0eb..aee6791 100644
--- a/hints/freebsd.sh
+++ b/hints/freebsd.sh
@@ -88,6 +88,8 @@ case "$osvers" in
 	esac
 	libswanted=`echo $libswanted | sed 's/ malloc / /'`
 	libswanted=`echo $libswanted | sed 's/ bind / /'`
+	libswanted=`echo $libswanted | sed 's/ dl / /'`
+	libswanted=`echo $libswanted | sed 's/ c / /'`
 	# iconv gone in Perl 5.8.1, but if someone compiles 5.8.0 or earlier.
 	libswanted=`echo $libswanted | sed 's/ iconv / /'`
 	d_setregid='define'
@@ -102,6 +104,10 @@ case "$osvers" in
 	        ;;
 	esac
 	libswanted=`echo $libswanted | sed 's/ malloc / /'`
+	libswanted=`echo $libswanted | sed 's/ bind / /'`
+	libswanted=`echo $libswanted | sed 's/ dl / /'`
+	libswanted=`echo $libswanted | sed 's/ iconv / /'`
+	libswanted=`echo $libswanted | sed 's/ c / /'`
 	;;
 esac
 
@@ -125,15 +131,15 @@ case "$osvers" in
         else
             libpth="/usr/lib /usr/local/lib"
             glibpth="/usr/lib /usr/local/lib"
-            ldflags="-Wl,-E "
+            ldflags="%%PTHREAD_LIBS%% -Wl,-E "
             lddlflags="-shared "
         fi
         cccdlflags='-DPIC -fPIC'
         ;;
 *)
-       libpth="/usr/lib /usr/local/lib"
-       glibpth="/usr/lib /usr/local/lib"
-       ldflags="-Wl,-E "
+        libpth="/usr/lib /usr/local/lib"
+        glibpth="/usr/lib /usr/local/lib"
+        ldflags="%%PTHREAD_LIBS%% -Wl,-E "
         lddlflags="-shared "
         cccdlflags='-DPIC -fPIC'
        ;;
@@ -143,7 +149,7 @@ case "$osvers" in
 0*|1*|2*|3*) ;;
 
 *)
-	ccflags="${ccflags} -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H"
+	ccflags="${ccflags} %%PTHREAD_CFLAGS%% -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H"
 	if /usr/bin/file -L /usr/lib/libc.so | /usr/bin/grep -vq "not stripped" ; then
 	    usenm=false
 	fi
@@ -190,7 +196,9 @@ esac
 
 # This script UU/usethreads.cbu will get 'called-back' by Configure 
 # after it has prompted the user for whether to use threads.
-cat > UU/usethreads.cbu <<'EOCBU'
+## not quite - modern FreeBSD perl port is supposed to take care of that
+## we just add extra libraries and cflags nowadays
+cat > /dev/null <<'EOCBU'
 case "$usethreads" in
 $define|true|[yY]*)
         lc_r=`/sbin/ldconfig -r|grep ':-lc_r'|awk '{print $NF}'|sed -n '$p'`

@p5pRT
Copy link
Author

p5pRT commented Apr 27, 2010

From @tomhukins

On Tue, Apr 27, 2010 at 11​:58​:27AM -0500, Todd Rinaldo wrote​:

I'm making a bold assumption that a large portion of the freebsd
install base installs whatever ports provides.

I suspect you're right.

Therefore it would be advantageous that whatever p5p provides be as
close as possible to what ports provides for the hints file.

I agree, but it's not p5p's responsibility to do this. FreeBSD's
Porter's Handbook explains that port maintainers should submit their
patches upstream​:
http​://www.freebsd.org/doc/en/books/porters-handbook/dads-freedback.html

Tom

@p5pRT
Copy link
Author

p5pRT commented Apr 27, 2010

From @Tux

On Tue, 27 Apr 2010 12​:00​:26 -0500, Todd Rinaldo <toddr@​cpanel.net>
wrote​:

On Apr 27, 2010, at 11​:58 AM, Todd Rinaldo wrote​:

On Apr 27, 2010, at 11​:43 AM, H.Merijn Brand wrote​:

Thanks. Applied as commit a8ca765
That line shows it is in blead already
I was referring to the additional patch file I just sent

Ah

Huh. maybe I should send the patch then.

:)

I did not apply the patch, as I have no knowledge about FreeBSD
whatsoever, so I cannot say if it is correct.

FWIW I fully agree that we should be as close to what they use as
  possible (or vice-versa)

--
H.Merijn Brand http​://tux.nl Perl Monger http​://amsterdam.pm.org/
using 5.00307 through 5.12 and porting perl5.13.x on HP-UX 10.20, 11.00,
11.11, 11.23, and 11.31, OpenSuSE 10.3, 11.0, and 11.1, AIX 5.2 and 5.3.
http​://mirrors.develooper.com/hpux/ http​://www.test-smoke.org/
http​://qa.perl.org http​://www.goldmark.org/jeff/stupid-disclaimers/

@p5pRT
Copy link
Author

p5pRT commented Apr 27, 2010

From ben@morrow.me.uk

Quoth toddr@​cpanel.net (Todd Rinaldo)​:

- ldflags="-Wl,-E "
+ ldflags="%%PTHREAD_LIBS%% -Wl,-E "

This won't work outside of ports. The %%PTHREAD_LIBS%% is substituted
(by ports) with whatever the correct libs are for pthread linking on the
current version of FreeBSD. (The libs needed have changed several times
in the not too distant past.)

AIUI, the aim of this (and the usethreads.cbu bit below) is to ensure
that all perls, even those built without -Dusethreads, get linked
against the pthread libs. This helps avoid problems later when
extensions link against (libs that link against) the thread libraries,
since on FreeBSD they replace several libc functions and you can't mix
threaded and non-threaded use in one process. Imitating this behaviour
in core perl, while possibly useful, would require some more effort,
since we don't have the ports infrastructure on hand to provide
%%PTHREAD_LIBS%%.

The aim is certainly *not* to force perl to be built with -Dusethreads.
The default perl on FreeBSD is built without (perl) thread support.

Ben

@p5pRT
Copy link
Author

p5pRT commented Apr 27, 2010

From @doughera88

On Tue, 27 Apr 2010, Todd Rinaldo wrote​:

On Apr 27, 2010, at 11​:58 AM, Todd Rinaldo wrote​:

On Apr 27, 2010, at 11​:43 AM, H.Merijn Brand wrote​:

Thanks. Applied as commit a8ca765
That line shows it is in blead already
I was referring to the additional patch file I just sent

Huh. maybe I should send the patch then.

Ah, that makes more sense.

I agree with the general idea of trying to keep perl and various ports in
sync, though it also should be possible to build perl outside of the ports
system.

I do like how hints/openbsd.sh tries to cleanly separate things specific
to the way perl is built for that distribution from things required
in general on that operating system. I haven't looked at this freebsd
patch in any detail, but it may be appropriate to divide it up similarly.

In any case, this patch obviously can't be applied as is, since the
varlous %%PTRHEAD_%% things aren't defined anywhere by perl's Configure
mechanism. I assume the FreeBSD ports system somehow sets them (though
I don't know what it sets them to). There is also the question of
threading. Every time I have ever benchmarked it, threading comes at a
(small, but measurable) cost. The FreeBSD ports maintainers should,
obviously, choose the appropriate setting for their distribution.
However, it should be possible for a user compiling from source to turn
it off.

--
  Andy Dougherty doughera@​lafayette.edu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant