-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
undefined symbol: clock_gettime when running on ubuntu 12.04 64 bit #24
Comments
hmm, it's strange. I've tested php-uv on Ubuntu 11.04 64bit box but I didn't meet the error.
https://github.com/chobie/php-uv/blob/master/config.m4#L71 for now, can you re-create php-uv module?
I'll make ubuntu 12.04 64bit box and test this. |
I tried the solution above, it does not work. The symptom is, the uv.so is recognized correctly in php -m, but when i run a script with a uv_default_loop function call, it said: symbol lookup error, ... undefined symbol: clock_gettime |
I just verified ubuntu 11.04 64bit works fine, so at this point, i think the issue is realted to either a ubuntu version difference or gcc version difference. |
For ubuntu 12.04 64 bit now, I did a hack to make it work by using gcc 4.4.7. Here is what I did: apt-get install gcc-4.4 After this recompile everything and things start working, but ideally, it should work for the latest gcc |
I see. I'll modify config.m4 for latest gcc. |
Great! |
I spend some hours to fix this. But I couldn't fix at this moment. for now, please use gcc-4.4.7. |
Even with gcc-4.4.7 I'm still getting this. I'll give it another shot and see if I can get it to compile with the older gcc. It's likely I'm missing something. Or perhaps other parts of the build chain need to be downgraded as well? It's a clean install of Ubuntu 12.04.01 64bit. |
I did not try 10.04 64 bit yet, Di you try ubuntu 11.04 64bit? |
Oops, sorry, I meant 12.04. I'll edit. |
I recompiled php-uv by hand with the older gcc (4.4) on ubuntu 12.04.01 64bit and I can verify it works on there. |
Hi folks, just thought I'd drop this note here after struggling with the same thing. After trying, for a while, unsuccessfully to get librt to be linked properly in the makefile, I went ahead and executed: export LD_PRELOAD=/lib/x86_64-linux-gnu/librt.so.1 Prior to starting up my instance (i.e. if you're using apache/nginx or php5-fpm) and it works fine. It's a hack, but it works. |
@chrsm thank you. i'll re-construct my ubuntu box and try to improve config.m4 later. |
using I'll post a backtrace soon |
I compiled latest php-uv with gcc 4.6.3 but can not reproduce this problem.
|
heu @chobie , I think it requires GCC 4.7, available on ubuntu 12.10 I'm not at my office, I can confirm that later |
Do you have -lrt on the last linking line? Pasting the compiler/linker output may help. |
When I run a
Here is my system info:
I will install an older version of gcc, as proposed above, in the mean time. |
Tested with gcc/cpp 4.4, 4.6, and 4.7. Everything works on 4.4 but I get the above error on 4.6 and 4.7. Let me know if there's any debug info I can send you to help! |
I tried to compile php-uv with gcc 4.6.3 on ubuntu 12.04 64 bit box, it compiled successfully but when i run uv_default_loop() in the code, it says:
undefined symbol: clock_gettime
Best Regards,
Jim
The text was updated successfully, but these errors were encountered: