Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the gcc -R parameter do?

Tags:

c++

g++

autotools

I am trying to run an autotools configure script for the bson-cpp project, and it fails because it cannot determine what flags it needs to compile with boost_filesystem. A quick look at confg.log shows:

g++ -o conftest -g -O2   -pthread  -L/usr/local/lib -R/usr/local/lib -L/usr/local/libexec conftest.o -lboost_filesystem-mt  -lboost_system-mt >&5
g++: error: unrecognized option '-R'

So, naturally, I tried to find out what the R option does, but I can't seem to find it documented anywhere. I've checked here and here to no avail. What does the option do and how do I tell autotools not to use it?

like image 804
ctrlc-root Avatar asked Oct 22 '11 13:10

ctrlc-root


People also ask

What is the GCC used for?

It functions as a cross compiler, creating executable code for a platform other than the one on which the compiler is running. GCC is also a core component of the tightly integrated GNU toolchain, produced by the GNU Project, that includes glibc, Binutils, and the GNU Debugger (GDB).

What is GCC and how it works?

GCC is an integrated collection of compilers for several major programming languages, which as of this writing are C, C++, Objective-C, Java, FORTRAN, and Ada. The GNU compilers all generate machine code, not higher-level language code which is then translated via another compiler.

What does GCC mean in C++?

GCC stands for “GNU Compiler Collection”. GCC is an integrated distribution of compilers for several major programming languages. These languages currently include C, C++, Objective-C, Objective-C++, Fortran, Ada, D, and Go. The abbreviation GCC has multiple meanings in common use.

What is the GCC in simple terms?

abbreviation for Gulf Cooperation Council: a group of six countries in the Persian Gulf: Bahrain, Kuwait, Qatar, Oman, Saudi Arabia, and the United Arab Emirates. GCC countries make decisions together on trade, military spending, etc.


2 Answers

-R does not seem to be an option for g++ or gcc anywhere. -R may be a linker option on some platforms that is equivalent of -rpath to gnu ld, ... This seems to be a known bug in boost builds ... have a look at Use -Wl to pass arguments to the linker.

It actually has the patch available there

I am re-posting it for convenience, however PLEASE PLEASE look at the original URL linked above for official patch!

--- ../gnote/m4/boost.m4    2011-01-25 14:30:18.000000000 +0200
+++ m4/boost.m4 2011-02-27 20:57:11.686221539 +0200
@@ -403,7 +403,7 @@
       LDFLAGS=$boost_save_LDFLAGS
       LIBS=$boost_save_LIBS
       if test x"$Boost_lib" = xyes; then
-        Boost_lib_LDFLAGS="-L$boost_ldpath -R$boost_ldpath"
+        Boost_lib_LDFLAGS="-L$boost_ldpath -Wl,-R$boost_ldpath"
         Boost_lib_LDPATH="$boost_ldpath"
         break 6
       else
like image 129
Ahmed Masud Avatar answered Oct 06 '22 16:10

Ahmed Masud


It's an option similar to -rpath, but available only on some platforms. The script is maybe failing detecting your platform ?

like image 31
Marc Plano-Lesay Avatar answered Oct 06 '22 15:10

Marc Plano-Lesay