Building on OS X 10.9.1 with XCode 5.1, and XKORE 3 issue

Wrote new code? Fixed a bug? Want to discuss technical stuff? Feel free to post it here.

Moderator: Moderators

Message
Author
Thaize
Noob
Noob
Posts: 17
Joined: 19 Sep 2008, 22:16
Noob?: No

Building on OS X 10.9.1 with XCode 5.1, and XKORE 3 issue

#1 Post by Thaize »

Hey guys, I was having some issues with perl, HASH_FUN, some undefined symbols, and xkore 3 while building on Mavericks. Here's my ham handed patch to at least get it to build.

EDIT: Also had some problems with xkore 3 - Work around included in the second patch on this page. I just commented out the offending line, and tested. I'm not experiencing
any strangeness, but don't grok the code well enough to know if it's The Right Way.

The error message is:
Can't use an undefined value as a symbol reference at src/Network/XKoreProxy.pm line 297.

First, a bug with the shipped perl ('declaration of 'Perl___notused' has a different language linkage') so I had to patch its header using the patch here:
https://trac.macports.org/attachment/ti ... dNOOP.diff
file is located in /System/Library/Perl/5.16/darwin-thread-multi-2level/CORE
resulting in patch:

Code: Select all

--- perl.h.orig	2014-06-08 08:36:53.000000000 -0700
+++ perl.h	2014-06-08 08:39:36.000000000 -0700
@@ -359,7 +359,11 @@
 /* Rats: if dTHR is just blank then the subsequent ";" throws an error */
 /* Declaring a *function*, instead of a variable, ensures that we don't rely
    on being able to suppress "unused" warnings.  */
+#ifdef __cplusplus
+#define dNOOP (void)0
+#else
 #define dNOOP extern int Perl___notused(void)
+#endif

 #ifndef pTHX
 /* Don't bother defining tTHX and sTHX; using them outside
And the resultant patch to openkore

Code: Select all

Index: SConstruct
===================================================================
--- SConstruct	(revision 8871)
+++ SConstruct	(working copy)
@@ -22,8 +22,8 @@
 EXTRA_COMPILER_FLAGS = ['-Wall', '-O3', '-pipe']

 # Brew's readline
-DARWIN_INCLUDE_DIRECTORIES = ['/usr/local/opt/readline/include']
-DARWIN_LIBRARY_DIRECTORIES = ['/usr/local/opt/readline/lib']
+DARWIN_INCLUDE_DIRECTORIES = ['/usr/local/opt/readline/include', '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1']
+DARWIN_LIBRARY_DIRECTORIES = ['/usr/local/opt/readline/lib', '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib']

 ####################

@@ -276,6 +276,7 @@
 		if env.has_key('LIBS'):
 		 	for flag in env['LIBS']:
 				command += ['-l' + flag]
+                command += ['-stdlib=libstdc++']

 		print ' '.join(command)
 		return subprocess.call(command)
Index: src/Network/XKoreProxy.pm
===================================================================
--- src/Network/XKoreProxy.pm	(revision 8871)
+++ src/Network/XKoreProxy.pm	(working copy)
@@ -294,7 +294,7 @@
 			$self->serverDisconnect();
 		}

-		close($self->{proxy});
+		# close($self->{proxy});
 		$self->{waitClientDC} = undef;
 		debug "Removing pending packet from queue\n" if (defined $self->{packetPending});
 		$self->{packetPending} = '';
I haven't been able to test everyting but at least I get a successful build, and asked for server info. Will post with more if I stumble on something relevant.

BTW I am not advocating the patching of headers on a live system - ever. If there's a better way to handle that, please let me know!