{"id":90,"date":"2006-03-28T12:30:30","date_gmt":"2006-03-28T16:30:30","guid":{"rendered":"http:\/\/benjamin.smedbergs.us\/blog\/2006-03-28\/gcc-and-visibility-one-step-forward-hit-a-brick-wall\/"},"modified":"2006-03-28T12:30:30","modified_gmt":"2006-03-28T16:30:30","slug":"gcc-and-visibility-one-step-forward-hit-a-brick-wall","status":"publish","type":"post","link":"http:\/\/benjamin.smedbergs.us\/blog\/2006-03-28\/gcc-and-visibility-one-step-forward-hit-a-brick-wall\/","title":{"rendered":"GCC and visibility: one step forward, hit a brick wall"},"content":{"rendered":"<p>A while back, I posted a <a href=\"http:\/\/benjamin.smedbergs.us\/blog\/2005-10-27\/gcc-40-workaround\/\">workaround<\/a> that lets Mozilla compile and link properly, working around a <a href=\"http:\/\/gcc.gnu.org\/bugzilla\/show_bug.cgi?id=20297\">bug that is present in GCC 4<\/a>. I am happy to report that the GCC bug has been fixed on the GCC trunk, 4.1 branch, and 4.0 branch (it should appear in GCC4.0.4 and 4.1.1). I was very excited and immediately went off to build my own GCC and try to build XULRunner with it. No dice! Linking failed in toolkit\/library with a similar error as before:<\/p>\n<pre>relocation R_X86_64_PC32 against `nsINIParser::Init(nsILocalFile*)' can not be used when making a shared object; recompile with -fPIC<\/pre>\n<p>This might look at first glance like the same bug as before, but it&#8217;s not: the previous bug was about builtin functions like memcpy, while this bug is about class member functions. It is apparently some bad interaction between <code>#pragma GCC visibility push(hidden)<\/code> and a class-level attribute which is supposed to override that for default visibility. I managed after several hours of tedium to reduce the testcase to a 30-line <tt>.i<\/tt> file and have <a href=\"http:\/\/gcc.gnu.org\/bugzilla\/show_bug.cgi?id=26905\">filed the bug with GCC<\/a>.<\/p>\n<p>For the moment, though, it appears that GCC4.0.4 and 4.1.1 will not be able to compile Mozilla without the same hacks as I suggested previously:<br \/>\nConfigure with the following variable set:<\/p>\n<p><tt>ac_cv_visibility_pragma=no path\/to\/mozilla\/configure \u00e2\u20ac\u201cenable-options-here<\/tt><\/p>\n<p>or put this in your mozconfig:<\/p>\n<p><tt>ac_cv_visibility_pragma=no<\/tt> <em>(Don\u00e2\u20ac\u2122t prefix this with ac_add_options!)<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A while back, I posted a workaround that lets Mozilla compile and link properly, working around a bug that is present in GCC 4. I am happy to report that the GCC bug has been fixed on the GCC trunk, 4.1 branch, and 4.0 branch (it should appear in GCC4.0.4 and 4.1.1). I was very [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-90","post","type-post","status-publish","format-standard","hentry","category-mozilla"],"_links":{"self":[{"href":"http:\/\/benjamin.smedbergs.us\/blog\/wp-json\/wp\/v2\/posts\/90","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/benjamin.smedbergs.us\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/benjamin.smedbergs.us\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/benjamin.smedbergs.us\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/benjamin.smedbergs.us\/blog\/wp-json\/wp\/v2\/comments?post=90"}],"version-history":[{"count":0,"href":"http:\/\/benjamin.smedbergs.us\/blog\/wp-json\/wp\/v2\/posts\/90\/revisions"}],"wp:attachment":[{"href":"http:\/\/benjamin.smedbergs.us\/blog\/wp-json\/wp\/v2\/media?parent=90"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/benjamin.smedbergs.us\/blog\/wp-json\/wp\/v2\/categories?post=90"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/benjamin.smedbergs.us\/blog\/wp-json\/wp\/v2\/tags?post=90"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}