apache / incubator-pagespeed-ngx

Automatic PageSpeed optimization module for Nginx
http://ngxpagespeed.com/
Apache License 2.0
4.37k stars 362 forks source link

about install ngx_pagespeed without recompiling Tengine #502

Closed oneinstack closed 10 years ago

oneinstack commented 10 years ago

Tengine only support HTTP modules dynamically loaded.

if use dso_tool, error: nginx: [emerg] load module "/data/webservers/nginx/modules//ngx_pagespeed.so" failed (/data/webservers/nginx/modules//ngx_pagespeed.so: undefined symbol: __sync_add_and_fetch_4) in /data/webservers/nginx/conf/nginx.conf:8 configuration file /data/webservers/nginx/conf/nginx.conf test failed

jeffkaufman commented 10 years ago

Can you try adding -march=i686 to your compiler flags?

oneinstack commented 10 years ago

Static compilation mode (./configure --add-modules=path-src/ngx_pagesspeed ) is ok. However, if use dso_tool compiled ngx_pagespeed.so, loaded ngx_pagespeed.so error.

jeffkaufman commented 10 years ago

@yaoweibin any ideas?

yaoweibin commented 10 years ago

OK. I'll check this problem. Thanks for your report.

yaoweibin commented 10 years ago

@lj2007331 Could you show me your configure and install steps? And your OS? Thanks.

oneinstack commented 10 years ago

I tested many times. Debian 6 Ubuntu 12 and CentOS 6 has been passed, but CentOS 5.9 32bit have this problem. Please check your email, Can you see the issue in my VM. Look forward to your reply, Thanks!

yaoweibin commented 10 years ago

@jeffkaufman when I add the compile flag -march=i686, it's OK. What's the problem? How could I avoid it?

jeffkaufman commented 10 years ago

@lj2007331 it sounds like @yaoweibin couldn't reproduce your problem. Could you paste the specific commands you ran on your CentOS 5.9 32bit machine?

yaoweibin commented 10 years ago

@jeffkaufman I have reproduced this problem in CentOS 5.9 32bit machine. When I add the compile flag march=i686 in the dso_tool, the problem disappears. Can you explain why I should add this flag?

jeffkaufman commented 10 years ago

@yaoweibin The compiler needs to know that __sync_add_and_fetch_4 is ok, and this requires an instruction that didn't exist on i586 or i386.

Can we add to our config file a cflag to always set march=i686 and not require anyone to set it themself?

oneinstack commented 10 years ago

@yaoweibin @jeffkaufman I add the compile flag march=i686 in the dso_tool, the problem disappears. but I need to always set march=i686.

yaoweibin commented 10 years ago

@jeffkaufman Is this pull request OK for you? https://github.com/pagespeed/ngx_pagespeed/pull/504 @lj2007331 Could you test the above pull request for sure?

Thank you for your effort.

oneinstack commented 10 years ago

@yaoweibin I tested. /root/lnmp/src/ngx_pagespeed-master/config: line 89: =march=i686: command not found

jeffkaufman commented 10 years ago

@lj2007331 It looks like there was a typo in #504. I've merged it to master and fixed the typo in a48c243. If you pull from master you should get something that fixes this problem.

yaoweibin commented 10 years ago

Thank you, Jeff. I'm just testing and fixing this problem :). Your fix is good.