This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[gold] fix (?) gold --enable-plugins build
- From: Steven Bosscher <stevenb dot gcc at gmail dot com>
- To: binutils at sourceware dot org, Ian Lance Taylor <iant at google dot com>
- Date: Sun, 11 Oct 2009 14:45:29 +0200
- Subject: [gold] fix (?) gold --enable-plugins build
Hi all,
I tried to build gold with plugins enabled (../src/configure
--enable-gold --enable-plugins) and I got a build error:
../../src/gold/plugin.cc: In member function ‘void gold::Plugin::load()’:
../../src/gold/plugin.cc:102: error: ‘RTLD_NOW’ was not declared in this scope
../../src/gold/plugin.cc:102: error: ‘dlopen’ was not declared in this scope
../../src/gold/plugin.cc:112: error: ‘dlsym’ was not declared in this scope
make[4]: *** [plugin.o] Error 1
make[4]: *** Waiting for unfinished jobs
This happens with a CVS checkout of today. The problem seems to be
that gold.h (and therefore config.h) is included after using
ENABLE_PLUGINS. With the attached patch, the build finishes without
further trouble for me.
Could someone verify that the patch below is indeed needed, and
foster-parent it into the gold CVS repo?
Thanks,
Ciao!
Steven
* gold/plugin.cc: Include gold.h before using ENABLE_PLUGINS.
Index: gold/plugin.cc
===================================================================
RCS file: /cvs/src/src/gold/plugin.cc,v
retrieving revision 1.21
diff -u -p -r1.21 plugin.cc
--- gold/plugin.cc 10 Oct 2009 07:39:04 -0000 1.21
+++ gold/plugin.cc 11 Oct 2009 12:38:47 -0000
@@ -26,11 +26,12 @@
#include <string>
#include <vector>
+#include "gold.h"
+
#ifdef ENABLE_PLUGINS
#include <dlfcn.h>
#endif
-#include "gold.h"
#include "parameters.h"
#include "errors.h"
#include "fileread.h"