2014-01-25 51 views
1

我想配置autotooled項目中使用Linux Mint的存量自動工具來調用非標準 鏈接器(gold linker), 16/Ubuntu的13.10如何爲自動構建的構建配置非標準鏈接器?

我相信我會通過實現這一點:

  • libtoolize -ing項目
  • 運行./configure LD=/path/to/my/linker ... etc.

但是這已經ineffec略去。 libtoolize已成功。 後標準./configure; make我現在看到libtool是做 鏈接:

/bin/bash ./libtool --tag=CXX --mode=link g++ -g -O2 -o helloworld helloworld.o 

但經過LD=/path/to/my/linkerconfigure沒什麼區別。實驗上, 我甚至跑:

./configure LD=/does/not/exist 

希望挑起錯誤,但我沒有。輸出包含:

checking if the linker (/does/not/exist -m elf_x86_64) is GNU ld... no 
checking whether the g++ linker (/does/not/exist -m elf_x86_64) supports shared libraries... yes 

,然後一個make繼續鏈接,成功,因爲之前調用g++準確。

配置非標準鏈接器的正確方法是什麼?

回答

3

但通過LD = /路徑/要/我的/連接器配置沒有什麼區別

這是因爲LD是幾乎從來沒有,應該幾乎從來沒有被用來連接任何用戶空間程序。改爲使用適當的編譯器驅動程序gccg++等)來執行正確的鏈接。

什麼是配置非標準鏈接器的正確方法?

如果你有/some/path/ld,你想gcc使用該ld,通過-B/some/path標誌GCC。

然後,它遵循的是你可能想:

./configure CC='gcc -B/some/path' CXX='g++ -B/some/path' ...