Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Feb 2007 17:50:36 +0300
From:      Eygene Ryabinkin <rea-fbsd@codelabs.ru>
To:        Rainer Hurling <rhurlin@gwdg.de>
Cc:        Jiawei Ye <leafy7382@gmail.com>, freebsd-ports@freebsd.org
Subject:   Re: X.org, dlopen and -current problem
Message-ID:  <20070211145035.GH73008@codelabs.ru>
In-Reply-To: <45CDA111.9050100@gwdg.de>
References:  <c21e92e20702020820y1fbdf2f6s7d3e4d3404acb29d@mail.gmail.com> <45CD95A3.4010606@gwdg.de> <c21e92e20702100210y27e40541o794a1c9c8e4002bf@mail.gmail.com> <45CDA111.9050100@gwdg.de>

next in thread | previous in thread | raw e-mail | index | archive | help

--zhXaljGHf11kAtnf
Content-Type: text/plain; charset=koi8-r
Content-Disposition: inline

> After buildworld and buildkernel I have done a 'make delete-old-libs' and 
> removed objformat. I think now we are on the right path ...

I've managed to get xorg-server to run at 7-CURRENT. The attached file
should be put into the files/ directory of the xorg-server port (the
existing file should be overwritten). It works for me, so, please, test
it.

I've not been able to spot the deep reason, but the immediate reason
for failures was that no external symbols from the libraries were exported
in the 'Xorg' binary for the dlopen() function. The addition of
--export-dynamic flag to the 'ld' program solved the problem.

I will try to understand if objformat changes are related to this problem.
Jiawei, thanks for the pointer.
-- 
Eygene

--zhXaljGHf11kAtnf
Content-Type: text/plain; charset=koi8-r
Content-Disposition: attachment; filename="patch-FreeBSD.cf"

--- config/cf/FreeBSD.cf.orig	Wed May  4 04:14:57 2005
+++ config/cf/FreeBSD.cf	Fri Feb  9 08:26:54 2007
@@ -78,6 +78,7 @@
 #define HasIssetugid		YES
 #define HasPoll			YES
 #endif
+#define BuildHtmlManPages	NO
 
 #if OSMajorVersion >= 4
 #define HasGetIfAddrs		YES
@@ -116,15 +117,14 @@
 # endif
 # if (OSRelVersion < 500043)
 #  define NeedUIThrStubs	YES
-# endif
-# if (OSRelVersion >= 502102)
-#  define ThreadsLibraries	-lpthread
-# elif (OSRelVersion >= 500016)
-#  define ThreadsLibraries	-lc_r
+#  define BuildThreadStubLibrary	YES
+#  define SharedX11Reqs		$(LDPRELIB) $(XTHRSTUBLIB)
+#  define SharedXtReqs		$(LDPRELIB) $(XONLYLIB) $(SMLIB) $(ICELIB) $(XTHRSTUBLIB)
 # else
-#  define ThreadsLibraries	-pthread
+#  define BuildThreadStubLibrary	NO
 # endif
-# define SystemMTDefines	-D_THREAD_SAFE
+# define ThreadsLibraries	FreeBSDPTHREAD_LIBS
+# define SystemMTDefines	FreeBSDPTHREAD_CFLAGS
 #endif
 
 /* This fixes linking C programs against libGLU on FreeBSD 3.x */
@@ -172,12 +172,14 @@
 #endif
 #endif
 
-#ifndef CcCmd
-#define CcCmd			cc
-#endif
-#ifndef CplusplusCmd
-#define CplusplusCmd		c++
+#if BuildThreadStubLibrary && (!defined(UseInstalledX11) || !UseInstalledX11)
+#define CcCmd			$(CLIENTENVSETUP) FreeBSDCC
+#define CplusplusCmd		$(CLIENTENVSETUP) FreeBSDCXX
+#else
+#define CcCmd			FreeBSDCC
+#define CplusplusCmd		FreeBSDCXX
 #endif
+
 #define CppCmd			/usr/bin/cpp
 #define PreProcessCmd		CppCmd
 #define StandardCppOptions	-traditional
@@ -338,7 +340,7 @@
 #ifndef LibraryRpathLoadFlags
 # if UseRpath
 #  if UseElfFormat
-#   define LibraryRpathLoadFlags	-rpath $(USRLIBDIRPATH)
+#   define LibraryRpathLoadFlags	-Wl,-rpath $(USRLIBDIRPATH)
 #  else
 #   define LibraryRpathLoadFlags	-R $(USRLIBDIRPATH)
 #  endif
@@ -446,7 +448,9 @@
 #ifdef PpcArchitecture
 #define XF86INT10_BUILD		X86INT10_STUB
 #endif
-
+#ifdef PpcArchitecture
+#define XF86INT10_BUILD		X86INT10_STUB
+#endif
 #define StandardDefines	-DCSRG_BASED
 
 #if OSMajorVersion > 1
@@ -467,18 +471,8 @@
 #define XawI18nDefines		-DUSE_XWCHAR_STRING -DUSE_XMBTOWC
 #endif
 
-/* The GCC strength-reduce bug is fixed for FreeBSD 2.1.5 and later */
-#ifndef DefaultGcc2i386Opt
-#if OSMajorVersion > 2 || (OSMajorVersion == 2 && OSMinorVersion > 1) || (OSMajorVersion == 2 && OSMinorVersion == 1 && OSTeenyVersion >= 5)
-#define DefaultGcc2i386Opt -O2 GccAliasingArgs
-#endif
-#endif
-
-#ifdef i386Architecture
-# define OptimizedCDebugFlags DefaultGcc2i386Opt
-#else
-# define OptimizedCDebugFlags -O
-#endif
+#define DefaultGcc2i386Opt
+#define OptimizedCDebugFlags FreeBSDCFLAGS
 
 #ifndef PreIncDir
 # define PreIncDir	/usr/include
@@ -575,6 +569,13 @@
  */
 #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>

--zhXaljGHf11kAtnf--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070211145035.GH73008>