summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFranklin Wei <franklin@rockbox.org>2019-11-09 20:52:08 -0500
committerFranklin Wei <franklin@rockbox.org>2019-11-10 23:09:35 -0500
commit43c049b9ade5780e127259094e3ea288a4c3da21 (patch)
tree619dcb8e770ae43c2a91ec3fef396f4b9d68783a
parent4d510ab62836217984012e9b69929be33e9c6c7c (diff)
downloadrockbox-43c049b9ad.tar.gz
rockbox-43c049b9ad.tar.bz2
rockbox-43c049b9ad.zip
rbutil: fix windows cross compile (via M cross environment)
This fixes a couple of issues when cross-compiling for windows: - lib builds (i.e. mks5lboot) were overriding the cross CC/CXX with the native CC, producing incompatible binaries. - Qt made the accessibility plugin part of the core library, so we no longer need to import it. Change-Id: I9d884aee62dfa51d3624a3fa9b99c23b3b375f20
-rw-r--r--rbutil/rbutilqt/Makefile.libs20
-rw-r--r--rbutil/rbutilqt/main.cpp6
-rw-r--r--rbutil/rbutilqt/rbutilqt.pro7
-rw-r--r--utils/imxtools/sbtools/crypto.h2
4 files changed, 23 insertions, 12 deletions
diff --git a/rbutil/rbutilqt/Makefile.libs b/rbutil/rbutilqt/Makefile.libs
index bd0dc121af..fc304fef14 100644
--- a/rbutil/rbutilqt/Makefile.libs
+++ b/rbutil/rbutilqt/Makefile.libs
@@ -29,10 +29,14 @@ export TARGET_DIR
export RBBASE_DIR
export CFLAGS=$(EXTRALIB_CFLAGS)
export CC=$(EXTRALIBS_CC)
+export CXX=$(EXTRALIBS_CXX)
export AR=$(EXTRALIBS_AR)
libs: librbspeex libucl libipodpatcher libsansapatcher libmkamsboot libmktccboot libmkmpioboot libchinachippatcher libmkimxboot libmks5lboot
+# To support cross compiles, we explicitly pass the CC flag below for
+# all tools which override CC or CXX in their makefiles. CXX is only
+# used by mkimxboot.
librbspeex:
$(SILENT) $(MAKE) -C $(RBBASE_DIR)/tools/rbspeex BUILD_DIR=$(BUILD_DIR)/libspeex librbspeex.a
@@ -41,25 +45,25 @@ libucl:
$(SILENT)$(MAKE) -C $(RBBASE_DIR)/tools/ucl/src BUILD_DIR=$(BUILD_DIR)/ucl libucl.a
libipodpatcher:
- $(SILENT)$(MAKE) -C $(RBBASE_DIR)/rbutil/ipodpatcher BUILD_DIR=$(BUILD_DIR)/ipodpatcher libipodpatcher.a
+ $(SILENT)$(MAKE) -C $(RBBASE_DIR)/rbutil/ipodpatcher BUILD_DIR=$(BUILD_DIR)/ipodpatcher libipodpatcher.a CC=$(CC)
libsansapatcher:
- $(SILENT)$(MAKE) -C $(RBBASE_DIR)/rbutil/sansapatcher BUILD_DIR=$(BUILD_DIR)/sansapatcher libsansapatcher.a
+ $(SILENT)$(MAKE) -C $(RBBASE_DIR)/rbutil/sansapatcher BUILD_DIR=$(BUILD_DIR)/sansapatcher libsansapatcher.a CC=$(CC)
libmkamsboot:
- $(SILENT)$(MAKE) -C $(RBBASE_DIR)/rbutil/mkamsboot BUILD_DIR=$(BUILD_DIR)/mkamsboot libmkamsboot.a
+ $(SILENT)$(MAKE) -C $(RBBASE_DIR)/rbutil/mkamsboot BUILD_DIR=$(BUILD_DIR)/mkamsboot libmkamsboot.a CC=$(CC)
libmktccboot:
- $(SILENT)$(MAKE) -C $(RBBASE_DIR)/rbutil/mktccboot BUILD_DIR=$(BUILD_DIR)/mktccboot libmktccboot.a
+ $(SILENT)$(MAKE) -C $(RBBASE_DIR)/rbutil/mktccboot BUILD_DIR=$(BUILD_DIR)/mktccboot libmktccboot.a CC=$(CC)
libmkmpioboot:
- $(SILENT)$(MAKE) -C $(RBBASE_DIR)/rbutil/mkmpioboot BUILD_DIR=$(BUILD_DIR)/mkmpioboot libmkmpioboot.a
+ $(SILENT)$(MAKE) -C $(RBBASE_DIR)/rbutil/mkmpioboot BUILD_DIR=$(BUILD_DIR)/mkmpioboot libmkmpioboot.a CC=$(CC)
libchinachippatcher:
- $(SILENT)$(MAKE) -C $(RBBASE_DIR)/rbutil/chinachippatcher BUILD_DIR=$(BUILD_DIR)/chinachippatcher libchinachippatcher.a
+ $(SILENT)$(MAKE) -C $(RBBASE_DIR)/rbutil/chinachippatcher BUILD_DIR=$(BUILD_DIR)/chinachippatcher libchinachippatcher.a CC=$(CC)
libmkimxboot:
- $(SILENT)$(MAKE) -C $(RBBASE_DIR)/rbutil/mkimxboot BUILD_DIR=$(BUILD_DIR)/mkimxboot libmkimxboot.a
+ $(SILENT)$(MAKE) -C $(RBBASE_DIR)/rbutil/mkimxboot BUILD_DIR=$(BUILD_DIR)/mkimxboot libmkimxboot.a CC=$(CC) CXX=$(CXX)
libmks5lboot:
- $(SILENT)$(MAKE) -C $(RBBASE_DIR)/rbutil/mks5lboot BUILD_DIR=$(BUILD_DIR)/mks5lboot libmks5lboot.a
+ $(SILENT)$(MAKE) -C $(RBBASE_DIR)/rbutil/mks5lboot BUILD_DIR=$(BUILD_DIR)/mks5lboot libmks5lboot.a CC=$(CC)
diff --git a/rbutil/rbutilqt/main.cpp b/rbutil/rbutilqt/main.cpp
index f950d20403..93fb0f4b31 100644
--- a/rbutil/rbutilqt/main.cpp
+++ b/rbutil/rbutilqt/main.cpp
@@ -29,7 +29,11 @@
#include <QtPlugin>
#if QT_VERSION < 0x050000
Q_IMPORT_PLUGIN(qtaccessiblewidgets)
-#else
+#elif QT_VERSION < 0x050400
+/*
+ * accessibility is no longer a plugin after 5.4.0:
+ * <https://bugreports.qt.io/browse/QTBUG-37957?focusedCommentId=239189&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-239189>
+ */
Q_IMPORT_PLUGIN(AccessibleFactory)
#endif
#endif
diff --git a/rbutil/rbutilqt/rbutilqt.pro b/rbutil/rbutilqt/rbutilqt.pro
index cfd6fb39ab..43d74e59d7 100644
--- a/rbutil/rbutilqt/rbutilqt.pro
+++ b/rbutil/rbutilqt/rbutilqt.pro
@@ -32,6 +32,7 @@ unix:!mac:!noccache {
}
MACHINEFLAGS = $$find(QMAKE_CFLAGS, -m[63][42])
EXTRALIBS_OPTS += EXTRALIBS_CC=\"$$QMAKE_CC\"
+EXTRALIBS_OPTS += EXTRALIBS_CXX=\"$$QMAKE_CXX\"
EXTRALIBS_OPTS += EXTRALIB_CFLAGS=\"$$MACHINEFLAGS\" \
MYBUILDDIR = $$OUT_PWD/build/
@@ -251,8 +252,10 @@ macx {
}
static {
- QTPLUGIN += qtaccessiblewidgets
- LIBS += -L$$(QT_BUILD_TREE)/plugins/accessible -lqtaccessiblewidgets
+ if(equals(QT_MAJOR_VERSION, 5) : lessThan(QT_MINOR_VERSION, 4)) | lessThan(QT_MAJOR_VERSION, 5) {
+ QTPLUGIN += qtaccessiblewidgets
+ LIBS += -L$$(QT_BUILD_TREE)/plugins/accessible -lqtaccessiblewidgets
+ }
LIBS += -L.
DEFINES += STATIC
message("using static plugin")
diff --git a/utils/imxtools/sbtools/crypto.h b/utils/imxtools/sbtools/crypto.h
index e7ca31d72f..169197790b 100644
--- a/utils/imxtools/sbtools/crypto.h
+++ b/utils/imxtools/sbtools/crypto.h
@@ -32,7 +32,7 @@ extern "C" {
typedef uint8_t byte;
-/* crypto.c */
+/* crypto.cpp */
enum crypto_method_t
{
CRYPTO_NONE, /* disable */