Skip to content

Instantly share code, notes, and snippets.

@thehajime
Created November 14, 2013 05:30
Show Gist options
  • Save thehajime/7461909 to your computer and use it in GitHub Desktop.
Save thehajime/7461909 to your computer and use it in GitHub Desktop.
# HG changeset patch
# Parent 73285fae30f91d5e9ead36d2eab2222f9e40cb6e
Bug 1773 - DCE doesn't run on Fedora 19 (64bits)
diff -r 73285fae30f9 model/cooja-loader-factory.cc
--- a/model/cooja-loader-factory.cc Sun Nov 10 00:37:22 2013 +0900
+++ b/model/cooja-loader-factory.cc Thu Nov 14 12:30:28 2013 +0900
@@ -374,6 +374,8 @@
{
NS_LOG_FUNCTION (this << module << symbol);
void *p = dlsym (module, symbol.c_str ());
+ if (!p)
+ NS_LOG_WARN (dlerror());
return p;
}
diff -r 73285fae30f9 model/dce-manager.cc
--- a/model/dce-manager.cc Sun Nov 10 00:37:22 2013 +0900
+++ b/model/dce-manager.cc Thu Nov 14 12:30:28 2013 +0900
@@ -258,7 +258,7 @@
line += exeFullPath;
line += "'.";
AppendStatusFile (current->process->pid, current->process->nodeId, line);
- NS_ASSERT_MSG (!main, line.c_str ());
+ NS_ASSERT_MSG (main, line.c_str ());
}
else
{
diff -r 73285fae30f9 model/dlm-loader-factory.cc
--- a/model/dlm-loader-factory.cc Sun Nov 10 00:37:22 2013 +0900
+++ b/model/dlm-loader-factory.cc Thu Nov 14 12:30:28 2013 +0900
@@ -106,6 +106,8 @@
{
NS_LOG_FUNCTION (this << module << symbol);
void *p = dlsym (module, symbol.c_str ());
+ if (!p)
+ NS_LOG_WARN (dlerror());
return p;
}
diff -r 73285fae30f9 model/libc-ns3.h
--- a/model/libc-ns3.h Sun Nov 10 00:37:22 2013 +0900
+++ b/model/libc-ns3.h Thu Nov 14 12:30:28 2013 +0900
@@ -388,7 +388,8 @@
DCE_WITH_ALIAS (pthread_once)
DCE (pthread_getspecific)
DCE (pthread_setspecific)
-DCE (pthread_key_create)
+//DCE (pthread_key_create)
+DCE_WITH_ALIAS (pthread_key_create)
DCE (pthread_key_delete)
DCE (pthread_mutex_destroy)
DCE (pthread_mutex_init)
diff -r 73285fae30f9 model/libc.cc
--- a/model/libc.cc Sun Nov 10 00:37:22 2013 +0900
+++ b/model/libc.cc Thu Nov 14 12:30:28 2013 +0900
@@ -19,17 +19,20 @@
#define NATIVE_WITH_ALIAS DCE_WITH_ALIAS
#define NATIVE_WITH_ALIAS2 DCE_WITH_ALIAS2
+#define GCC_BT_NUM_ARGS 72
+//#define GCC_BT_NUM_ARGS 128
+
#define GCC_BUILTIN_APPLY(export_symbol, func_to_call) \
void export_symbol (...) { \
void *args = __builtin_apply_args (); \
- void *result = __builtin_apply (g_libc.func_to_call ## _fn, args, 128); \
+ void *result = __builtin_apply (g_libc.func_to_call ## _fn, args, GCC_BT_NUM_ARGS); \
__builtin_return (result); \
}
#define GCC_BUILTIN_APPLYT(rtype, export_symbol, func_to_call) \
rtype export_symbol (...) { \
void *args = __builtin_apply_args (); \
- void *result = __builtin_apply ((void (*) (...)) g_libc.func_to_call ## _fn, args, 128); \
+ void *result = __builtin_apply ((void (*) (...)) g_libc.func_to_call ## _fn, args, GCC_BT_NUM_ARGS); \
__builtin_return (result); \
}
diff -r 73285fae30f9 wscript
--- a/wscript Sun Nov 10 00:37:22 2013 +0900
+++ b/wscript Thu Nov 14 12:30:28 2013 +0900
@@ -199,7 +199,7 @@
debug_dl = []
d['cxxflags'] = d.get('cxxflags', []) + ['-fpie'] + mcmodel + nofortify
d['cflags'] = d.get('cflags', []) + ['-fpie'] + mcmodel + nofortify
- d['linkflags'] = d.get('linkflags', []) + ['-pie'] + ['-lrt'] + debug_dl
+ d['linkflags'] = d.get('linkflags', []) + ['-pie'] + ['-lrt'] + ['-rdynamic'] + debug_dl
return d
def build_dce_tests(module, bld):
diff -r 73285fae30f9 wutils.py
--- a/wutils.py Sun Nov 10 00:37:22 2013 +0900
+++ b/wutils.py Thu Nov 14 12:30:28 2013 +0900
@@ -120,9 +120,9 @@
else:
pymoddir = ""
import glob
- pyns3dir = glob.glob(bld.env.NS3_DIR + '/lib/python*/site-packages')
+ pyns3dir = glob.glob(bld.env.NS3_DIR + '/lib*/python*/site-packages')
if len(pyns3dir) is not 0:
- pyvizdir = pyns3dir[0]
+ pyvizdir = pyns3dir[1]
else:
pyvizdir = ''
if 'PYTHONPATH' in proc_env:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment