What does the gcc -R parameter do?

前端 未结 3 1213
[愿得一人]
[愿得一人] 2021-01-12 03:21

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 q

相关标签:
3条回答
  • 2021-01-12 03:31

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

    0 讨论(0)
  • 2021-01-12 03:31

    It is not a valid option for GCC, so it does not do anything.

    It is possibly a valid option for other compilers though, which could be why autoconf gives it a shot.

    Not all errors in the config.log files are a problem. autoconf figures out a lot of things by "guessing", i.e. trying something and keeping that if it worked.

    0 讨论(0)
  • 2021-01-12 03:40

    -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
    
    0 讨论(0)
提交回复
热议问题