Add ppc64le cross-compilation support#9
Conversation
resources/ubuntu-build.sh
Outdated
| echo " DEPOT_TOOLS_DIR: Directory containing Google depot tools" | ||
| echo " WEBRTC_DIR: Directory containing WebRTC source" | ||
| echo " ARCH: Architecture to build for (x86_64 or arm64)" | ||
| echo " ARCH: Architecture to build for (x86_64 or arm64 or ppc64le)" |
There was a problem hiding this comment.
Should be a comma-separated list: (x86_64, arm64, or ppc64le). Your choice whether to use the Oxford comma.
resources/Makefile.2
Outdated
| @@ -0,0 +1,55 @@ | |||
| # Build libdcsctp.a on non-"gn" supported architectures | |||
There was a problem hiding this comment.
You seem to have also checked in a Makefile.2 -- was this a mistake?
| CXXFLAGS += -I $(S)/third_party/crc32c/src/include | ||
| # Assume all non-test .cc files under net/dcsctp are needed by libdcsctp4j.so. | ||
| # "gn/ninja" includes 43 extra objects but they are not needed by | ||
| # libdcsctp4j.so. |
There was a problem hiding this comment.
I'd like to verify that that dcsctp4j still links at -O0 (which may be needed for debugging) with just this list of files? It's possible that some dependencies from those 43 extra objects get optimized out.
There was a problem hiding this comment.
I found a few missing symbols with:
nm --demangle -D dcsctp4j/src/main/resources/linux-ppc64le/libdcsctp4j.so | grep ' U ' | grep -v @
I added six extra objects required to define them.
I added a debug argument to ubuntu-build.sh to test this. libdcsctp4j.so built with -O0 works on my ppc64le Jitsi setup.
resources/Makefile
Outdated
| # Assume all non-test .cc files under net/dcsctp are needed by libdcsctp4j.so. | ||
| # "gn/ninja" includes 43 extra objects but they are not needed by | ||
| # libdcsctp4j.so. | ||
| TESTS = $(wildcard $(S)/net/dcsctp/*/*_test.cc $(S)/net/dcsctp/*/*/*_test.cc) |
There was a problem hiding this comment.
There's also common/handover_testing.cc which doesn't match this pattern. I think if you make the pattern *_test*.cc you'll match that file as well.
resources/ubuntu-build.sh
Outdated
| rm -rf $WEBRTC_BUILD | ||
| gn gen $WEBRTC_BUILD --args="use_custom_libcxx=false target_cpu=\"$GN_ARCH\" is_debug=false symbol_level=2" | ||
| ninja -C $WEBRTC_BUILD dcsctp | ||
| if test -z "$GNU_ARCH"; then |
There was a problem hiding this comment.
I'm not crazy about having this choice be implicit based on the presence or absence of GNU_ARCH; can you have something like an explicit BUILD_DCSCTP_WITH_MAKEFILE argument instead?
There was a problem hiding this comment.
Done, as an argument to ubuntu-build.sh.
Add a Makefile that can be used to cross-compile libdcsctp.a for architectures that "gn" does not support.
2d0dcd6 to
3aa9332
Compare
|
Thank you for reviewing. I addressed all your comments, and added optional verbose and debug support as extra commits. To keep the history clean but keep discussion on the same pull request I force-pushed the branch, so you will have to check it out again. |
This reverts commit 3f09928.
|
Unfortunately this PR didn't work after I merged it, so I've reverted it. There were a few problems:
because all the object directories were on a single command line and our paths on our build machine are fairly deep.
matched things that weren't directories -- this is possibly a bug in the version of glibc's
I can do PRs against your branch to fix all three of those; however you'll need to open a new PR against dcsctp4j, because it doesn't look like GitHub has any way to re-open a merged PR. |
|
OK, I pushed a rebased redo branch, https://github.com/fitzsim/dcsctp4j/tree/ppc64le-support-4. Do you want to send me pull requests against that before I submit it as a new pull request? |
|
I have my pull requests against your branch at fitzsim#2 |
|
Resubmitted as #11, thank you. |
I tested:
on
x86-64Debian 12.x86-64andaarch64libraries built as before, and theppc64lecross-compilation succeeded. I tested the new library:on my
Debian 12ppc64leJitsiinstallation and it worked when I initiated a two-party meeting:I made
ninjaverbose so that its compiler arguments are available in continuous integration logs for comparison with those specified by the newMakefile.The other two
ubuntu-build.shchanges reorder some lines in preparation for the addition of theppc64lelogic.