building error when linking to one more library

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

building error when linking to one more library

Yuhao-2
Hi All,

I met some problem when linking to libpfm. The error message was:

/usr/bin/python2.7 /home/yuhao/Documents/mozilla-release/config/
pythonpath.py -I../../config /home/yuhao/Documents/mozilla-release/
config/expandlibs_exec.py --uselist -- c++ -o firefox -fno-rtti -
pedantic -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-
dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -
Wno-variadic-macros -Werror=return-type -Wno-long-long -I/usr/local/
include -fno-exceptions -fno-strict-aliasing -std=gnu++0x -pthread -
ffunction-sections -fdata-sections -pipe -DNDEBUG -DTRIMMED -g -Os -
freorder-blocks -fomit-frame-pointer nsBrowserApp.o -lpthread -Wl,-
rpath-link,/home/yuhao/Documents/mozilla-release/firefox-release/dist/
bin -Wl,-rpath-link,/usr/local/lib -Wl,--whole-archive /home/yuhao/
Documents/mozilla-release/firefox-release/dist/lib/libmozglue.a -Wl,--
no-whole-archive -rdynamic -L../../dist/bin -L../../dist/lib -lpfm -L/
usr/local/lib /home/yuhao/Documents/mozilla-release/firefox-release/
dist/lib/libxpcomglue.a -ldl -lpfm

nsBrowserApp.o: In function `main':
/home/yuhao/Documents/mozilla-release/browser/app/nsBrowserApp.cpp:
218: undefined reference to `pfm_initialize'
/usr/bin/ld.bfd.real: firefox: hidden symbol `pfm_initialize' isn't
defined
/usr/bin/ld.bfd.real: final link failed: Bad value
collect2: ld returned 1 exit status

This doesn't make sense to me. I specified the library name (-lpfm),
as well as the path for the linker to find it (-L/usr/local/lib). I am
sure these paths are correct.

I also tried not to use the python script, but just normal building:

c++ -o firefox -fno-rtti -pedantic -Wall -Wpointer-arith -Woverloaded-
virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-
align -Wno-invalid-offsetof -Wno-variadic-macros -Werror=return-type -
Wno-long-long -I/usr/local/include -fno-exceptions -fno-strict-
aliasing -std=gnu++0x -pthread -ffunction-sections -fdata-sections -
pipe -DNDEBUG -DTRIMMED -g -Os -freorder-blocks -fomit-frame-pointer
nsBrowserApp.o -lpthread -Wl,-rpath-link,/home/yuhao/Documents/mozilla-
release/firefox-release/dist/bin -Wl,-rpath-link,/usr/local/lib -Wl,--
whole-archive /home/yuhao/Documents/mozilla-release/firefox-release/
dist/lib/libmozglue.a -Wl,--no-whole-archive -rdynamic -L../../dist/
bin -L../../dist/lib -lpfm -L/usr/local/lib /home/yuhao/Documents/
mozilla-release/firefox-release/dist/lib/libxpcomglue.a -ldl -lpfm

And it just worked. So I assume the problem was with the python
script. I am not familiar with python, so could anyone help me with
this?

Thanks,
Yuhao
_______________________________________________
dev-embedding mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-embedding