New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
openexr: fix cross-compilation #61245
Conversation
@GrahamcOfBorg build pkgsCross.aarch64-multiplatform.openexr |
I think I see what's going wrong here. On my machine, I had |
@Synthetica9 FYI you mean "So we need to compile part of this project on the build platform, to generate all the sources." |
4de4f26
to
061e3a2
Compare
@GrahamcOfBorg build pkgsCross.aarch64-multiplatform.openexr |
I might take a look at using |
I wonder if Linux has a way to disable binfmt in a process? That would help avoid cases like this. |
OK try this: diff --git a/OpenEXR/IlmImf/Makefile.am b/OpenEXR/IlmImf/Makefile.am
index c047b1e..c341eee 100644
--- a/OpenEXR/IlmImf/Makefile.am
+++ b/OpenEXR/IlmImf/Makefile.am
@@ -196,14 +196,14 @@ INCLUDES = @ILMBASE_CXXFLAGS@ \
CLEANFILES = b44ExpLogTable b44ExpLogTable.h dwaLookups dwaLookups.h
-b44ExpLogTable_SOURCES = b44ExpLogTable.cpp
-b44ExpLogTable_LDADD = @ILMBASE_LDFLAGS@ $(ILMBASE_LIBS)
+b44ExpLogTable$(EXEEXT_FOR_BUILD): b44ExpLogTable.cpp
+ $(CXX_FOR_BUILD) $(CXXFLAGS_FOR_BUILD) $< -o $@
b44ExpLogTable.h: b44ExpLogTable
./b44ExpLogTable > b44ExpLogTable.h
-dwaLookups_SOURCES = dwaLookups.cpp
-dwaLookups_LDADD = @ILMBASE_LDFLAGS@ $(ILMBASE_LIBS)
+dwaLookups$(EXEEXT_FOR_BUILD): dwaLookups.cpp
+ $(CXX_FOR_BUILD) $(CXXFLAGS_FOR_BUILD) $< -o $@
dwaLookups.h: dwaLookups
./dwaLookups > dwaLookups.h
diff --git a/OpenEXR/configure.ac b/OpenEXR/configure.ac
index 067f9d0..5a9c4dd 100644
--- a/OpenEXR/configure.ac
+++ b/OpenEXR/configure.ac
@@ -30,6 +30,8 @@ AC_PROG_CC
AC_PROG_LN_S
AC_PROG_LIBTOOL
AC_PROG_MAKE_SET
+AX_CC_FOR_BUILD dnl for EXEEXT_FOR_BUILD not CC_FOR_BUILD
+AX_PROG_CXX_FOR_BUILD
dnl
dnl PKGCONFIG preparations which I through together (no testing) based off of 694b4d2 using AcademySoftwareFoundation/openexr#221. I think If that works, please submit upstream! Maybe include the earlier patch with |
Looks promising, but I don't think I'm comfortable enough with Automake to make it work.
|
I dug around for a bit, and it doesn't look like it. This might be worth filing a kernel feature request for. |
061e3a2
to
a347ec5
Compare
@GrahamcOfBorg build pkgsCross.aarch64-multiplatform.openexr |
@Ericson2314 Would you mind merging this in the meantime? I couldn't get your solution to work, and this already better than the current situation. |
@GrahamcOfBorg build openexr |
AcademySoftwareFoundation/openexr#384 I got sucked in and then stuck. This is definitely good enough :). |
BTW this sort of patch is the sort that really makes me doubt whether it's a good idea to support cross-compilation, because it adds considerable complexity and makes it harder to maintain/update the openexr package. |
openexr: fix cross-compilation
@edolstra I don't know how you can draw a general story about cross compilation support from this. Maybe I'm basically finished making big infra overhauls for cross; it works now. If somebody else wants a package to work a take that as external demand, not my own dream, and try to assist them. I'm obviously biased, but I think the feature is pretty popular? |
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)