Closed Bug 844630 Opened 8 years ago Closed 8 years ago

testing/gtest/gtest/src/gtest-death-test.cc:894: error: undefined reference to 'environ'

Categories

(Testing :: General, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla22

People

(Reporter: gps, Assigned: msreckovic)

References

Details

Attachments

(1 file)

Tried to perform a build with --enable-gtest on Ubuntu 12.10 and got the following when linking libxul:

11:18.93 /usr/bin/ld.gold.real: warning: hidden symbol 'pixman_add_triangles' in /home/gps/src/mozilla-central/obj-firefox/toolkit/library/../../gfx/cairo/libpixman/src/pixman-trap.o is referenced by DSO /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libcairo.so
11:18.93 /usr/bin/ld.gold.real: error: /home/gps/src/mozilla-central/obj-firefox/toolkit/library/../../testing/gtest/gtest-all.o: requires dynamic R_X86_64_PC32 reloc against 'environ' which may overflow at runtime; recompile with -fPIC
11:18.93 /home/gps/src/mozilla-central/testing/gtest/gtest/src/gtest-death-test.cc:894: error: undefined reference to 'environ'
11:18.93 clang: error: linker command failed with exit code 1 (use -v to see invocation)
11:18.93 make[5]: *** [libxul.so] Error 1
11:18.93 make[4]: *** [libs_tier_platform] Error 2
11:18.93 make[3]: *** [tier_platform] Error 2
11:18.94 make[2]: *** [default] Error 2
11:18.94 make[1]: *** [realbuild] Error 2
11:18.94 make: *** [build] Error 2
Depends on: gtest
Can you try doing the analogous change made in bug 758843?
Flags: needinfo?(gps)
The equivalent of Bug 758843 fixed it for me.
Attachment #718506 - Flags: review?(bgirard)
Comment on attachment 718506 [details] [diff] [review]
Be explicit about environ extern visibility

Thanks!
Attachment #718506 - Flags: review?(bgirard) → review+
https://hg.mozilla.org/mozilla-central/rev/036f8a67636c
Assignee: nobody → msreckovic
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
You need to log in before you can comment on or make changes to this bug.