pkgsrc-Bugs archive

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

pkg/25249: editors/xemacs won't compile on FreeBSD 5.2.1, fix attached



>Number:         25249
>Category:       pkg
>Synopsis:       editors/xemacs won't compile on FreeBSD 5.2.1, fix attached
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 20 00:02:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Michal Pasternak
>Release:        N/A
>Organization:
Good People With Bad Reputation
>Environment:
FreeBSD mainframe.w.lub.pl 5.2.1-RC FreeBSD 5.2.1-RC #0: Sat Jan 31 05:36:22 
GMT 2004     
root%cypress.btc.adpatec.com@localhost:/usr/obj/usr/src/sys/GENERIC  i386

>Description:
Well, I've promised myself not to send any more PRs. Seems I've changed
my mind. Please be so kind then and don't let this one wait too long.

editors/xemacs build on FreeBSD 5.2.1-RC will break at configure phase:
========================================================================
checking size of short... 0

*** PANIC *** Configure tests are not working - compiler is broken.
*** PANIC *** Please examine config.log for compilation errors.
*** Error code 1

Stop.
bmake: stopped in /usr/pkgsrc/editors/xemacs
*** Error code 1
========================================================================

... while config.log contains:
========================================================================
configure:4513: checking size of short
configure:4527: gcc -o conftest -pipe -Dunix -I/usr/pkg/include -I/usr/include 
-I/usr/pkg/include/
freetype2 -I/usr/pkg/include -I/usr/include -I/usr/pkg/include/freetype2  
-I/usr/obj/pkgsrc/editor
s/xemacs/work.j1/.buildlink/include -I/usr/obj/pkgsrc/editors/xemacs/work.j1    
  -Xlinker -pthrea
d -L/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/lib -Wl,-R/usr/lib 
-L/usr/pkg/X11R6/lib -Wl,-R/usr/pkg/
X11R6/lib  -Xlinker -z -Xlinker nocombreloc 
-L/usr/obj/pkgsrc/editors/xemacs/work.j1/.buildlink/li
b     conftest.c         -lutil -lxpg4 -lgcc -lc -lgcc /usr/lib/crtend.o 
/usr/lib/crtn.o 1>&5
/usr/bin/ld: unrecognized option '-pthread'
/usr/bin/ld: use the --help option for usage information
configure: failed program was:
#line 4516 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(short));
  exit(0);
}

========================================================================
>How-To-Repeat:
Obvious.
>Fix:
The configure script in many places uses such construct:
============================================================
if test "$GCC" = "yes"; then
  set x $ld_switch_machine; shift; ld_switch_machine=""
  while test -n "$1"; do
    case $1 in
      -L  | -l  | -u               ) ld_switch_machine="$ld_switch_machine $1 
$2"; shift ;;
      -L* | -l* | -u* | -Wl* | -pg ) ld_switch_machine="$ld_switch_machine $1" 
;;
      -Xlinker* ) ;;
      * ) ld_switch_machine="$ld_switch_machine -Xlinker $1" ;;
    esac
    shift
  done
fi
============================================================

As you can clearly see, "-pthread" will match *) rule, and will
be appended as an option for ld (after -Xlinker). 

On FreeBSD this is very wrong.

So then, we patch the script so it includes "-pthread" _before_
-Xlinker, just as it would do with -l*, -pg and such:

    ... -pg | -pthread ) ...

Perhaps the same patch applies for xemacs-current, but I haven't
checked. I've described the method clearly enough, so you should
get it.

Patch is at:
http://pkgsrc.w.lub.pl/xemacs_freebsd.patch

Have fun!
>Release-Note:
>Audit-Trail:
>Unformatted:



Home | Main Index | Thread Index | Old Index