From rea-fbsd@codelabs.ru  Mon Feb 12 15:56:39 2007
Return-Path: <rea-fbsd@codelabs.ru>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 494D016A400
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 12 Feb 2007 15:56:39 +0000 (UTC)
	(envelope-from rea-fbsd@codelabs.ru)
Received: from pobox.codelabs.ru (pobox.codelabs.ru [144.206.177.45])
	by mx1.freebsd.org (Postfix) with ESMTP id 07AD013C46B
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 12 Feb 2007 15:56:39 +0000 (UTC)
	(envelope-from rea-fbsd@codelabs.ru)
Received: from localdomain
	by pobox.codelabs.ru with local
	id 1HGdXf-0004Lg-Cz for FreeBSD-gnats-submit@freebsd.org; Mon, 12 Feb 2007 18:56:35 +0300
Message-Id: <E1HGdXf-0004Lg-Cz@pobox.codelabs.ru>
Date: Mon, 12 Feb 2007 18:56:35 +0300
From: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
Sender: rea-fbsd@codelabs.ru
Reply-To: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: make Xorg from x11-servers/xorg-server port to work on 7-CURRENT
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         109091
>Category:       ports
>Synopsis:       make Xorg from x11-servers/xorg-server port to work on 7-CURRENT
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-x11
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb 12 16:00:11 GMT 2007
>Closed-Date:    Thu Feb 22 21:43:33 GMT 2007
>Last-Modified:  Fri Feb 23 02:30:07 GMT 2007
>Originator:     Eygene Ryabinkin
>Release:        FreeBSD 7.0-CURRENT i386
>Organization:
Code Labs
>Environment:

>Description:

Starting from the middle of January (not precisely) the Xorg binary,
when built from ports, is unable to start on 7-CURRENT since it can
not dlopen() some required modules (the bitmap module is the most
frequent cause of the errors). Investigation showed that Xorg
lacks the global symbols from the 'loader' subsystem to be
exported for the glopen()/dlsym(). The addition of the --export-dynamic
flag to the 'ld' linker solved that problem.

Not sure that this is related to the recent removal of the objformat,
but I've not investigated this.

Here are two relevant mailing list topics:
http://lists.freebsd.org/pipermail/freebsd-ports/2007-February/038495.html
http://lists.freebsd.org/pipermail/freebsd-current/2007-February/069116.html

The problem is not specific to sparc: it is spotted on sparc64,
i386 and ia64. My fix was tested for i386 and ia64. No answer from
sparc64 side yet.

>How-To-Repeat:
Install 7-CURRENT, build xorg-server on it and try to start Xorg
binary. It will complain about the libbitmap.so and unresolved
symbols.
>Fix:

You should add the following lines to the end of the
files/FreeBSD.cf file:
-----
/*
 * Add --export-dynamic flag for FreeBSD 7.x and later.
 */
#if OSMajorVersion >= 7
#define ExtraLoadOptions -Wl,--export-dynamic
#endif
-----
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->freebsd-x11 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Feb 12 16:00:26 UTC 2007 
Responsible-Changed-Why:  
Over to maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=109091 

From: Szilveszter Adam <sziszi@bsd.hu>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: ports/109091 make Xorg from x11-servers/xorg-server port to work on 7-CURRENT
Date: Sun, 18 Feb 2007 07:20:04 +0100

 --x+6KMIRAuhnl3hBn
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 After some investigation I have found a hint to connect this problem to
 the removal of objformat(1) on -CURRENT.
 
 In short, the port needs the same patch that was applied to the
 devel/imake-6 port because it uses a private copy of the imake sources
 during build. I am not sure if it is needed for every xorg port, but
 probably all of them need it that build and install libraries.
 
 The patch is trivial and is attached to avoid mangling.
 -- 
 Regards:
 
 Szilveszter ADAM
 Budapest
 Hungary
 
 --x+6KMIRAuhnl3hBn
 Content-Type: text/x-csrc; charset=us-ascii
 Content-Disposition: attachment; filename="patch-imake.c"
 
 --- config/imake/imake.c.orig	Tue Jan 30 14:57:37 2007
 +++ config/imake/imake.c	Tue Jan 30 14:55:59 2007
 @@ -1153,29 +1153,17 @@
    int mib[2];
    size_t len;
    int osrel = 0;
 -  FILE *objprog = NULL;
    int iself = 0;
 -  char buf[10];
 -  char cmd[PATH_MAX];
  
    mib[0] = CTL_KERN;
    mib[1] = KERN_OSRELDATE;
    len = sizeof(osrel);
    sysctl(mib, 2, &osrel, &len, NULL, 0);
 -  if (CrossCompiling) {
 -      strcpy (cmd, CrossCompileDir);
 -      strcat (cmd, "/");
 -      strcat (cmd,"objformat");
 -  } else
 -      strcpy (cmd, "objformat");
  
 -  if (osrel >= 300004 &&
 -      (objprog = popen(cmd, "r")) != NULL &&
 -      fgets(buf, sizeof(buf), objprog) != NULL &&
 -      strncmp(buf, "elf", 3) == 0)
 +  if (osrel < 300004)
 +    iself = 0;
 +  else
      iself = 1;
 -  if (objprog)
 -    pclose(objprog);
  
    fprintf(inFile, "#define DefaultToElfFormat %s\n", iself ? "YES" : "NO");
  }
 
 --x+6KMIRAuhnl3hBn--

From: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
To: Diabolo <diabolo@cafelug.org.ar>
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/109091: make Xorg from x11-servers/xorg-server port to work on 7-CURRENT
Date: Mon, 19 Feb 2007 10:58:57 +0300

 > this file FreeBSD.cf doesnt exist
 
 OK, I was in rush and made a mistake. Attaching the proper patch
 to the files/patch-FreeBSD.cf
 --- patch-patch-FreeBSD.cf begins here ---
 --- patch-FreeBSD.cf.orig	Mon Feb 19 10:46:16 2007
 +++ patch-FreeBSD.cf	Mon Feb 19 10:45:52 2007
 @@ -1,5 +1,5 @@
 ---- config/cf/FreeBSD.cf.orig	Sun Aug 15 10:03:36 2004
 -+++ config/cf/FreeBSD.cf	Sun Feb  6 03:56:59 2005
 +--- FreeBSD.cf.orig	Wed May  4 08:14:57 2005
 ++++ FreeBSD.cf	Mon Feb 19 10:39:59 2007
  @@ -78,6 +78,7 @@
   #define HasIssetugid		YES
   #define HasPoll			YES
 @@ -59,9 +59,9 @@
   #  else
   #   define LibraryRpathLoadFlags	-R $(USRLIBDIRPATH)
   #  endif
 -@@ -442,7 +444,9 @@
 - #define AsVISOption		-Av9a
 - #define AsOutputArchSize	64
 +@@ -446,7 +448,9 @@
 + #ifdef PpcArchitecture
 + #define XF86INT10_BUILD		X86INT10_STUB
   #endif
  -
  +#ifdef PpcArchitecture
 @@ -70,7 +70,7 @@
   #define StandardDefines	-DCSRG_BASED
   
   #if OSMajorVersion > 1
 -@@ -463,18 +467,8 @@
 +@@ -467,18 +471,8 @@
   #define XawI18nDefines		-DUSE_XWCHAR_STRING -DUSE_XMBTOWC
   #endif
   
 @@ -91,3 +91,18 @@
   
   #ifndef PreIncDir
   # define PreIncDir	/usr/include
 +@@ -576,6 +570,14 @@
 + #if (GccMajorVersion == 2 && GccMinorVersion == 95)
 + #define GccOptBug295
 + #endif
 ++
 ++/*
 ++ * Add --export-dynamic flag for FreeBSD 7.x and later.
 ++ */
 ++#if OSMajorVersion >= 7
 ++#define ExtraLoadOptions -Wl,--export-dynamic
 ++#endif
 ++
 + 
 + #include <bsdLib.rules>
 + 
 --- patch-patch-FreeBSD.cf ends here ---
 
 > the file is patch-FreeBSD.cf i put that lines and rebuild xorg-server
 > and still have the issue.
 
 What port version do you have? What is the output from the
 'elfdump -a /usr/X11R6/bin/Xorg'.
 
 Szilveszter Adam has suggested another workaround, maybe you should
 try it. It is on the PR page now.
 -- 
 Eygene

From: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/109091: make Xorg from x11-servers/xorg-server port to work on 7-CURRENT
Date: Tue, 20 Feb 2007 08:21:38 +0300

 Mon, Feb 19, 2007 at 10:58:56AM +0300, Eygene Ryabinkin wrote:
 >
 > OK, I was in rush and made a mistake. Attaching the proper patch
 > to the files/patch-FreeBSD.cf
 
 I was in a rush again. Here is the correct version of my patch to
 files/patch-FreeBSD.cf that will enable the patched patch to find
 the file to patch ;))
 
 --- patch-patch-FreeBSD.cf begins here ---
 --- patch-FreeBSD.cf.orig	Mon Feb 19 10:46:16 2007
 +++ patch-FreeBSD.cf	Mon Feb 19 10:45:52 2007
 @@ -1,5 +1,5 @@
 ---- config/cf/FreeBSD.cf.orig	Sun Aug 15 10:03:36 2004
 -+++ config/cf/FreeBSD.cf	Sun Feb  6 03:56:59 2005
 +--- config/cf/FreeBSD.cf.orig	Wed May  4 08:14:57 2005
 ++++ config/cf/FreeBSD.cf	Mon Feb 19 10:39:59 2007
  @@ -78,6 +78,7 @@
   #define HasIssetugid		YES
   #define HasPoll			YES
 @@ -59,9 +59,9 @@
   #  else
   #   define LibraryRpathLoadFlags	-R $(USRLIBDIRPATH)
   #  endif
 -@@ -442,7 +444,9 @@
 - #define AsVISOption		-Av9a
 - #define AsOutputArchSize	64
 +@@ -446,7 +448,9 @@
 + #ifdef PpcArchitecture
 + #define XF86INT10_BUILD		X86INT10_STUB
   #endif
  -
  +#ifdef PpcArchitecture
 @@ -70,7 +70,7 @@
   #define StandardDefines	-DCSRG_BASED
   
   #if OSMajorVersion > 1
 -@@ -463,18 +467,8 @@
 +@@ -467,18 +471,8 @@
   #define XawI18nDefines		-DUSE_XWCHAR_STRING -DUSE_XMBTOWC
   #endif
   
 @@ -91,3 +91,18 @@
   
   #ifndef PreIncDir
   # define PreIncDir	/usr/include
 +@@ -576,6 +570,14 @@
 + #if (GccMajorVersion == 2 && GccMinorVersion == 95)
 + #define GccOptBug295
 + #endif
 ++
 ++/*
 ++ * Add --export-dynamic flag for FreeBSD 7.x and later.
 ++ */
 ++#if OSMajorVersion >= 7
 ++#define ExtraLoadOptions -Wl,--export-dynamic
 ++#endif
 ++
 + 
 + #include <bsdLib.rules>
 + 
 --- patch-patch-FreeBSD.cf ends here ---
 -- 
 Eygene

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/109091: commit references a PR
Date: Thu, 22 Feb 2007 21:18:06 +0000 (UTC)

 lesi        2007-02-22 21:18:01 UTC
 
   FreeBSD ports repository
 
   Modified files:
     x11-servers/xorg-server Makefile.inc 
   Added files:
     x11-servers/xorg-server/files patch-imake.c 
   Log:
   Fix loading modules on current by adding patch from devel/imake-6 since
   local copy of imake is used at configuring. Since FreeBSD versions older
   than 300004 are not supported, simplify patch to just return elf for
   default.
   
   PR:             ports/109091
   Submitted by:   Szilveszter Adam (sziszi at bsd dot hu)
   
   Revision  Changes    Path
   1.18      +2 -1      ports/x11-servers/xorg-server/Makefile.inc
   1.1       +38 -0     ports/x11-servers/xorg-server/files/patch-imake.c (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: lesi 
State-Changed-When: Thu Feb 22 21:42:20 UTC 2007 
State-Changed-Why:  
Patch from devel/imake-6 was copied over and simplified a bit. 
Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=109091 

From: Doug Barton <dougb@FreeBSD.org>
To: bug-followup@FreeBSD.org,  rea-fbsd@codelabs.ru,  lesi@freebsd.org
Cc:  
Subject: Re: ports/109091: make Xorg from x11-servers/xorg-server port to
 work on 7-CURRENT
Date: Thu, 22 Feb 2007 18:01:51 -0800

 Just a quick 'me too.' Prior to the port's update today I had the same 
 problem, the fix worked.
 
 hth,
 
 Doug
 
 -- 
 
      This .signature sanitized for your protection
 
>Unformatted:
