» Building GCC plugins on Mac OS X 10.9.4
Building GCC plugins on Mac OS X 10.9.4
|September 13, 2014
Posted by forumadmin
I am trying to re-build a simple GCC plugin (which builds fine on GNU Linux).
I am intending to compile the plugin using GNU GCC v4.6.3 which I have already installed under Mac OS X.
The Makefile contents are given below:
PLUGIN_OBJECT_FILES= $(patsubst %.c,%.o,$(PLUGIN_SOURCE_FILES))
GCCPLUGINS_DIR= $(shell $(GCC) -print-file-name=plugin)
CFLAGS+= -I$(GCCPLUGINS_DIR)/include -I/Users/xxx/compilers/gcc-4.6.3/install/include - I/Users/xxx/compilers/gcc-4.6.3/gcc/ -fPIC -O0 -g3
$(GCC) -shared $^ -o $@
$(GCC) $(CFLAGS) -I$(GCCPLUGINS_DIR) -c $^ -o $@
rm *.o *.so
I am getting the following error:
Undefined symbols for architecture x86_64:
"_register_callback", referenced from:
_plugin_init in plugin_base.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [plugin_base.so] Error 1
GCC compiler is built using the following configuration:
../gcc-4.6.3/configure --prefix=/Users/xxx/compilers/gcc-4.6.3/install/ --program-suffix=-4.6.3.x --enable-languages=c,c++ --disable-multilib --enable-cloog-backend=isl --with-gmp=/Users/xxx/compilers/gcc-4.6.3/install/ --with-mpfr=/Users/xxx/compilers/gcc-4.6.3/install/ --with-mpc=/Users/xxx/compilers/gcc-4.6.3/install/ --with-ppl=/Users/xxx/compilers/gcc-4.6.3/install/ --with-cloog=/Users/xxx/compilers/gcc-4.6.3/install/
More Related Questions
- cross compiling why cant ld find shared library / how to debug further? Im trying to cross-compile and link aggregate on ubuntu for my arm-router and I get the following error. In the past I think I have been able to workaround this by setting the appropriate […]
- Trouble with gcc linker – compiling c functions for python I am trying to compile some c based video decoder functions I found on github in order to run them as functions in python. Unfortunately, I'm running into gcc linker problems. I'm pretty […]
- ld cannot find an existing library I am attempting to link an application with g++ on this Debian lenny system. ld is complaining it cannot find specified libraries. The specific example here is ImageMagick, but I am having […]
- code segment referenced again with second plugin crashes I'd like to understand the dynamic-linker/loader behaviour on Linux box in the problematic case I work upon.
Our code that crashes is loaded as a plugin (dlopen(libwrapper.so, […]
- Compile with QtCreator on mac with c++11 I want to compile with QtCreator 2.6.2 a program that uses Qt framework 4.8 and syntax of c++11.
So in .pro file I have this line:
QMAKE_CXXFLAGS += -std=c++0x
Possibly I'd like to use […]
- Cross compiling GCC with newlib for ARM: how to specify GCC options like -march? I've compiled GCC along with newlib on Mac OS X for ARM targets. However, libc.a was compiled with -fshort-enums, and I don't want that because when I compile stuff for ARM, I use […]
- What does the -all_load linker flag do? I can't find anywhere what the -all_load flag do when compiling Objective-C code.
I have some issues uploading binaries to Apple, the they say it's because I didn't use this flag, but my […]
- What is the default linker in CMake when custom path to compiler is set? I use export CXX=../gcc-installation/bin/i686-elf-g++ on ubuntu 14.3 lts to set the C++ compiler path for CMake. Now does the CMake use the compiler to link the program together? I'd like […]
- Linker order – GCC Why does the order in which libraries are linked sometimes cause errors? Asked By - Landon Read Answers
- SonarQube on mac doesnt start after plugin After installing SonarQube 4.3.1 through Brew on Mac OS 10.9 Mavericks, when I navigate to localhost:9000, I could see the console but now after trying to install an Android plugin and […]