summaryrefslogtreecommitdiffstats
path: root/native_client_sdk/src/examples/tutorial/dlopen/dlopen.cc
diff options
context:
space:
mode:
authorsbc@chromium.org <sbc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-06 20:35:45 +0000
committersbc@chromium.org <sbc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-06 20:35:45 +0000
commit79f3f56b150582e8fd176b090cbe72d9598784a0 (patch)
treefa0bd6bffc8601322948d2ad99a9f46716252380 /native_client_sdk/src/examples/tutorial/dlopen/dlopen.cc
parentd0f03f0ac25862d07fdf6911a52afe85bb6c2eb7 (diff)
downloadchromium_src-79f3f56b150582e8fd176b090cbe72d9598784a0.zip
chromium_src-79f3f56b150582e8fd176b090cbe72d9598784a0.tar.gz
chromium_src-79f3f56b150582e8fd176b090cbe72d9598784a0.tar.bz2
[NaCl SDK] Remove NACL_ARCH from commom makefiles.
This macro was only used by one example, but was appearing on the compile line for all examples. Also, it can be detected more empirically at compile time using GCC's builtins. R=binji@chromium.org BUG=None Review URL: https://codereview.chromium.org/15974011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204582 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'native_client_sdk/src/examples/tutorial/dlopen/dlopen.cc')
-rw-r--r--native_client_sdk/src/examples/tutorial/dlopen/dlopen.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/native_client_sdk/src/examples/tutorial/dlopen/dlopen.cc b/native_client_sdk/src/examples/tutorial/dlopen/dlopen.cc
index 7d13a10..9291464 100644
--- a/native_client_sdk/src/examples/tutorial/dlopen/dlopen.cc
+++ b/native_client_sdk/src/examples/tutorial/dlopen/dlopen.cc
@@ -23,9 +23,15 @@
#define CONFIG_NAME "Release"
#endif
-#define XSTRINGIFY(x) STRINGIFY(x)
-#define STRINGIFY(x) #x
-#define NACL_ARCH_STRING XSTRINGIFY(NACL_ARCH)
+#if defined __arm__
+#define NACL_ARCH "arm"
+#elif defined __i686__
+#define NACL_ARCH "x86_32"
+#elif defined __x86_64__
+#define NACL_ARCH "x86_64"
+#else
+#error "Unknown arch"
+#endif
class DlOpenInstance : public pp::Instance {
public:
@@ -66,7 +72,7 @@ class DlOpenInstance : public pp::Instance {
// dlclose, which would close the shared object and unload it from memory.
void LoadLibrary() {
const char reverse_so_path[] =
- "/http/glibc/" CONFIG_NAME "/libreverse_" NACL_ARCH_STRING ".so";
+ "/http/glibc/" CONFIG_NAME "/libreverse_" NACL_ARCH ".so";
const int32_t IMMEDIATELY = 0;
eightball_so_ = dlopen("libeightball.so", RTLD_LAZY);
reverse_so_ = dlopen(reverse_so_path, RTLD_LAZY);