petersont / o3d

Imported from code.google.com/p/o3d
2 stars 1 forks source link

o3d does not build properly on ChromeOS #246

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. emerge-x86-zgb o3d.
2.
3.

What is the expected output? What do you see instead?

Expected output should be clean compile. I see this:

  g++ -pthread -Wl,-z,noexecstack -m32 -Wl,--gc-sections  -o out/Release/mksnapshot -Wl,--start-group out/Release/obj.host/mksnapshot/v8/src/mksnapshot.o out/Release/obj.host/v8/tools/gyp/libv8_nosnapshot.a out/Release/obj.host/v8/tools/gyp/libv8_base.a -Wl,--end-group -lrt
  export LD_LIBRARY_PATH=/build/x86-zgb/tmp/portage/media-plugins/o3d-100004/work/o3d-100004/out/Release/lib.host:/build/x86-zgb/tmp/portage/media-plugins/o3d-100004/work/o3d-100004/out/Release/lib.target:$LD_LIBRARY_PATH; cd v8/tools/gyp; mkdir -p /build/x86-zgb/tmp/portage/media-plugins/o3d-100004/work/o3d-100004/out/Release/obj.target/geni; "/build/x86-zgb/tmp/portage/media-plugins/o3d-100004/work/o3d-100004/out/Release/mksnapshot" "/build/x86-zgb/tmp/portage/media-plugins/o3d-100004/work/o3d-100004/out/Release/obj.target/geni/snapshot.cc"
/build/x86-zgb/tmp/portage/media-plugins/o3d-100004/work/o3d-100004/out/Release/
mksnapshot: error while loading shared libraries: libstdc++.so.6: cannot open 
shared object file: No such file or directory

I think the reason for this is that o3d's build system uses the cross compiler 
to build libv8_base.a which is linked against some .o files produced by the 
host compiler. Host compiler binaries should not be mixed with cross-compiler 
binaries.

When I do ldd on mksnapshot, I get:

    linux-gate.so.1 =>  (0xf7737000)
    librt.so.1 => /lib32/librt.so.1 (0xf7722000)
    libstdc++.so.6 => not found
    libm.so.6 => /lib32/libm.so.6 (0xf76fc000)
    libgcc_s.so.1 => /lib32/libgcc_s.so.1 (0xf76e0000)
    libpthread.so.0 => /lib32/libpthread.so.0 (0xf76c6000)
    libc.so.6 => /lib32/libc.so.6 (0xf757d000)
    /lib/ld-linux.so.2 (0xf7738000)

This is because the host libstdc++.so.6 isn't the one that it requires.

This command works (because I add the cross libstdc++.so path to 
LD_LIBRARY_PATH):

/build/x86-zgb/tmp/portage/media-plugins/o3d-100004/work/o3d-100004 $ 
LD_LIBRARY_PATH=/usr/lib/gcc/i686-pc-linux-gnu/4.6.0/gcc/i686-pc-linux-gnu/4.6.x
-google/ ldd ./out/Release/mksnapshot

    linux-gate.so.1 =>  (0xf7708000)
    librt.so.1 => /lib32/librt.so.1 (0xf76f3000)
    libstdc++.so.6 => /usr/lib/gcc/i686-pc-linux-gnu/4.6.0/gcc/i686-pc-linux-gnu/4.6.x-google/libstdc++.so.6 (0xf75f2000)
    libm.so.6 => /lib32/libm.so.6 (0xf75cc000)
    libgcc_s.so.1 => /usr/lib/gcc/i686-pc-linux-gnu/4.6.0/gcc/i686-pc-linux-gnu/4.6.x-google/libgcc_s.so.1 (0xf75af000)
    libpthread.so.0 => /lib32/libpthread.so.0 (0xf7596000)
    libc.so.6 => /lib32/libc.so.6 (0xf744d000)
    /lib/ld-linux.so.2 (0xf7709000)

Basically we need to make sure all the binaries that run on the host like 
mksnapshot are not pulling in any .o files produced by the cross compiler.

What version of the product are you using? On what operating system?

o3d on ChromeOS.

What hardware are you using:  graphics card type?  motherboard type?

Please provide any additional information below.

Original issue reported on code.google.com by asha...@chromium.org on 8 Nov 2011 at 7:07

GoogleCodeExporter commented 9 years ago
After a bit of experimentation, I found out that the -m32 flag is the culprit. 
It comes from: ./build/common.gypi around line 1013.

Why does o3d use this flag for the host compilation?

Original comment by asha...@chromium.org on 8 Nov 2011 at 8:35

GoogleCodeExporter commented 9 years ago
You can close this issue. It is fixed by: 
https://gerrit.chromium.org/gerrit/#change,11344.

Original comment by asha...@chromium.org on 9 Nov 2011 at 1:06