diff options
author | David P <megver83@parabola.nu> | 2018-05-05 17:14:39 -0300 |
---|---|---|
committer | David P <megver83@parabola.nu> | 2018-05-05 17:14:39 -0300 |
commit | ea1f2d25bfb09eb46ec0fe75b50c5a67c2eab150 (patch) | |
tree | 0d8df2fb6ec60aa55809be5b3a1f22671a57bf11 /libre/linux-libre-firmware | |
parent | 88a62e57ce83be878e9766d14944cc89d8e7317f (diff) | |
download | abslibre-ea1f2d25bfb09eb46ec0fe75b50c5a67c2eab150.tar.gz abslibre-ea1f2d25bfb09eb46ec0fe75b50c5a67c2eab150.tar.bz2 abslibre-ea1f2d25bfb09eb46ec0fe75b50c5a67c2eab150.zip |
libre/linux-libre-firmware: rebuild with GCC8
Other changes:
- update makedepends
- add 0001-remove-external-toolchains.patch to replace remove-wget.patch
- add 0002-carl9170fw-gcc-8-fix.patch
Signed-off-by: David P <megver83@parabola.nu>
Diffstat (limited to 'libre/linux-libre-firmware')
-rw-r--r-- | libre/linux-libre-firmware/0001-remove-external-toolchains.patch (renamed from libre/linux-libre-firmware/remove-wget.patch) | 182 | ||||
-rw-r--r-- | libre/linux-libre-firmware/0002-carl9170fw-gcc-8-fix.patch | 95 | ||||
-rw-r--r-- | libre/linux-libre-firmware/PKGBUILD | 21 |
3 files changed, 261 insertions, 37 deletions
diff --git a/libre/linux-libre-firmware/remove-wget.patch b/libre/linux-libre-firmware/0001-remove-external-toolchains.patch index f2364631c..13ec21f50 100644 --- a/libre/linux-libre-firmware/remove-wget.patch +++ b/libre/linux-libre-firmware/0001-remove-external-toolchains.patch @@ -1,5 +1,76 @@ +From aeedcc04bd0a6aad5f025f8860a29516de159932 Mon Sep 17 00:00:00 2001 +From: David P <megver83@parabola.nu> +Date: Sun, 29 Apr 2018 13:54:13 -0300 +Subject: [PATCH 1/2] remove external toolchains + +Make ath9k_htc and carl9170fw build without depending on downloading compilers, and +remove related files, so it can be built offline using the system ones. + +Changes to src/: + + - ath9k_htc: + * target_firmware/configure: use the system's xtensa-elf cross-compiler + * Makefile: set CFLAGS + * README: ommit the toolchain building instructions + * .travis.yml: remove `make toolchain' from script + * local: delete directory + - carl9170fw: + * extra/sh-elf-linux.cmake: use the system's sh-elf cross-compiler + * README.md: ommit the toolchain building instructions + * toolchain: delete directory + - INSTALL: + * remove GNU Wget from the list of dependencies + * add sh-elf and xtensa-elf toolchains to the list of dependencies + - Makefile: + * remove ath9k_htc_toolchain, carl9170fw-toolchain and related commands + * build carl9170fw with `./autogen.sh --alldefconfig' + +Signed-off-by: David P <megver83@parabola.nu> +--- + src/INSTALL | 10 +- + src/Makefile | 19 +- + src/ath9k_htc/.travis.yml | 1 - + src/ath9k_htc/Makefile | 150 +- + src/ath9k_htc/README | 14 +- + src/ath9k_htc/local/patches/binutils-2.27_fixup.patch | 13 - + src/ath9k_htc/local/patches/binutils.patch | 28962 ------------------------------------ + src/ath9k_htc/local/patches/gcc-6.3.0_fixup.patch | 49 - + src/ath9k_htc/local/patches/gcc.patch | 92 - + src/ath9k_htc/local/patches/gcc.patch2 | 13 - + src/ath9k_htc/target_firmware/configure | 2 +- + src/carl9170fw/README.md | 11 - + src/carl9170fw/extra/sh-elf-linux.cmake | 16 +- + src/carl9170fw/toolchain/Makefile | 104 - + src/carl9170fw/toolchain/SHA256SUMS | 14 - + 15 files changed, 31 insertions(+), 29439 deletions(-) + +diff --git a/src/INSTALL b/src/INSTALL +index dfabf2a..be6c905 100644 +--- a/src/INSTALL ++++ b/src/INSTALL +@@ -20,11 +20,19 @@ system: + * GNU Flex + * GNU Gperf + * GNU Make +- * GNU Wget ++ * Newlib for sh-elf target + * GNU C cross-compiler for ARM: + - arm-linux-gnueabi-gcc + - arm-linux-gnueabi-ld + - arm-linux-gnueabi-objcopy ++ * GNU C cross-compiler for Xtensa: ++ - xtensa-elf-gcc ++ - xtensa-elf-ld ++ - xtensa-elf-objcopy ++ * GNU C cross-compiler for SuperH: ++ - sh-elf-gcc ++ - sh-elf-ld ++ - sh-elf-objcopy + + CARL9170 Firmware Configuration + When building the carl9170 firmware you will be prompted with diff --git a/src/Makefile b/src/Makefile -index 122f659..89a8209 100644 +index 122f659..c2b8451 100644 --- a/src/Makefile +++ b/src/Makefile @@ -17,7 +17,7 @@ shell=/bin/sh @@ -7,7 +78,7 @@ index 122f659..89a8209 100644 install_program=install -.PHONY: all test clean install a56 as31 ath9k_htc_toolchain ath9k_htc_firmware av7110 b43-tools carl9170fw-toolchain carl9170fw cis-tools cis dsp56k ihex2fw isci keyspan_pda openfwwf usbdux -+.PHONY: all test clean install a56 as31 ath9k_htc ath9k_htc_firmware av7110 b43-tools carl9170fw carl9170fw cis-tools cis dsp56k ihex2fw isci keyspan_pda openfwwf usbdux ++.PHONY: all test clean install a56 as31 ath9k_htc ath9k_htc_firmware av7110 b43-tools carl9170fw cis-tools cis dsp56k ihex2fw isci keyspan_pda openfwwf usbdux all: ath9k_htc av7110 carl9170fw cis dsp56k isci keyspan_pda openfwwf usbdux @@ -25,7 +96,7 @@ index 122f659..89a8209 100644 av7110: cd av7110 && $(MAKE) -@@ -39,10 +36,7 @@ av7110: +@@ -39,11 +36,8 @@ av7110: b43-tools: cd b43-tools/assembler && $(MAKE) @@ -33,10 +104,12 @@ index 122f659..89a8209 100644 - cd carl9170fw && $(MAKE) -C toolchain - -carl9170fw: carl9170fw-toolchain +- cd carl9170fw && ./autogen.sh +carl9170fw: - cd carl9170fw && ./autogen.sh ++ cd carl9170fw && ./autogen.sh --alldefconfig cis: cis-tools + cd cis && $(MAKE) @@ -75,10 +69,9 @@ test: clean: cd a56 && $(MAKE) clean @@ -49,6 +122,17 @@ index 122f659..89a8209 100644 if [ -a carl9170fw/Makefile ]; then cd carl9170fw && $(MAKE) clean; fi; cd dsp56k && $(MAKE) clean cd ihex2fw && $(MAKE) clean +diff --git a/src/ath9k_htc/.travis.yml b/src/ath9k_htc/.travis.yml +index cfb0ee1..5a8db8f 100644 +--- a/src/ath9k_htc/.travis.yml ++++ b/src/ath9k_htc/.travis.yml +@@ -19,6 +19,5 @@ addons: + - cmake + + script: +- - make toolchain + - make -C target_firmware + - make -C target_firmware clean diff --git a/src/ath9k_htc/Makefile b/src/ath9k_htc/Makefile index ee5e61b..3f9c66d 100644 --- a/src/ath9k_htc/Makefile @@ -209,7 +293,32 @@ index ee5e61b..3f9c66d 100644 -$(eval $(call Build,GCC,MPC MPFR)) + +.PHONY: all clean firmware -diff --git a/src/ath9k_htc/local/patches/binutils-2.27_fixup.patch a/src/ath9k_htc/local/patches/binutils-2.27_fixup.patch +diff --git a/src/ath9k_htc/README b/src/ath9k_htc/README +index 93823e4..bd14e8f 100644 +--- a/src/ath9k_htc/README ++++ b/src/ath9k_htc/README +@@ -48,19 +48,7 @@ You're in for a treat. + * Install the cmake build tool (http://www.cmake.org/). + Major distributions have packages for this. + +-* For FreeBSD - install gmake and wget. +- +-* You first have to build the toolchain. +- +- * Linux: +- +- $ make toolchain +- +- * FreeBSD: +- +- $ gmake toolchain +- +- (Yes, I made this work on FreeBSD as well.) ++* For FreeBSD - install gmake. + + * Next, build the firmware. + +diff --git a/src/ath9k_htc/local/patches/binutils-2.27_fixup.patch b/src/ath9k_htc/local/patches/binutils-2.27_fixup.patch deleted file mode 100644 index fb61345..0000000 --- a/src/ath9k_htc/local/patches/binutils-2.27_fixup.patch @@ -228,7 +337,7 @@ index fb61345..0000000 - - free (cnt_arg); - *cnt_argp = new_arg; -diff --git a/src/ath9k_htc/local/patches/binutils.patch a/src/ath9k_htc/local/patches/binutils.patch +diff --git a/src/ath9k_htc/local/patches/binutils.patch b/src/ath9k_htc/local/patches/binutils.patch deleted file mode 100644 index 8246771..0000000 --- a/src/ath9k_htc/local/patches/binutils.patch @@ -29196,7 +29305,7 @@ index 8246771..0000000 --- -1.8.1 - -diff --git a/src/ath9k_htc/local/patches/gcc-6.3.0_fixup.patch a/src/ath9k_htc/local/patches/gcc-6.3.0_fixup.patch +diff --git a/src/ath9k_htc/local/patches/gcc-6.3.0_fixup.patch b/src/ath9k_htc/local/patches/gcc-6.3.0_fixup.patch deleted file mode 100644 index 681c0ee..0000000 --- a/src/ath9k_htc/local/patches/gcc-6.3.0_fixup.patch @@ -29251,7 +29360,7 @@ index 681c0ee..0000000 - else - output_addr_const (file, x); - } -diff --git a/src/ath9k_htc/local/patches/gcc.patch a/src/ath9k_htc/local/patches/gcc.patch +diff --git a/src/ath9k_htc/local/patches/gcc.patch b/src/ath9k_htc/local/patches/gcc.patch deleted file mode 100644 index b26cc56..0000000 --- a/src/ath9k_htc/local/patches/gcc.patch @@ -29349,7 +29458,7 @@ index b26cc56..0000000 - - #undef XCHAL_MAX_INSTRUCTION_SIZE - #define XCHAL_MAX_INSTRUCTION_SIZE 3 -diff --git a/src/ath9k_htc/local/patches/gcc.patch2 a/src/ath9k_htc/local/patches/gcc.patch2 +diff --git a/src/ath9k_htc/local/patches/gcc.patch2 b/src/ath9k_htc/local/patches/gcc.patch2 deleted file mode 100644 index 4d82574..0000000 --- a/src/ath9k_htc/local/patches/gcc.patch2 @@ -29369,15 +29478,11 @@ index 4d82574..0000000 - return false; - diff --git a/src/ath9k_htc/target_firmware/configure b/src/ath9k_htc/target_firmware/configure -index e2d4639..4d0de5c 100755 +index e2d4639..6e49093 100755 --- a/src/ath9k_htc/target_firmware/configure +++ b/src/ath9k_htc/target_firmware/configure -@@ -35,10 +35,10 @@ - # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ## - --TARGET=xtensa-elf -+TARGET=xtensa-unknown-elf +@@ -38,7 +38,7 @@ + TARGET=xtensa-elf [ -z "$CROSS_COMPILE" ] && - CROSS_COMPILE="$PWD/../toolchain/inst/bin/$TARGET-" @@ -29385,8 +29490,30 @@ index e2d4639..4d0de5c 100755 TOOLCHAIN_FILE="$PWD/build/toolchain.cmake" +diff --git a/src/carl9170fw/README.md b/src/carl9170fw/README.md +index 65a3aa7..440ea20 100644 +--- a/src/carl9170fw/README.md ++++ b/src/carl9170fw/README.md +@@ -8,17 +8,6 @@ driver or the tools supplied in the repository. + + ## Build + +-### Build Toolchain +- +-To build the firmware you will need an SH-2 toolchain. +-You can use the makefile in this repository to build +-your own toolchain: +- +-`# make -C toolchain` +- +-but be aware that this will take some time and requires +-about 3-5 GiB disk space. +- + ### Build Firmware Image + + The firmware configuration and build process requires the following diff --git a/src/carl9170fw/extra/sh-elf-linux.cmake b/src/carl9170fw/extra/sh-elf-linux.cmake -index 3fdf98c..36e3b63 100644 +index 3fdf98c..c0b1e84 100644 --- a/src/carl9170fw/extra/sh-elf-linux.cmake +++ b/src/carl9170fw/extra/sh-elf-linux.cmake @@ -3,19 +3,19 @@ set(CMAKE_SYSTEM_PROCESSOR "sh2") @@ -29407,17 +29534,17 @@ index 3fdf98c..36e3b63 100644 -set(CMAKE_ASM-ATT_COMPILER ${CMAKE_SOURCE_DIR}/toolchain/inst/bin/sh-elf-as) -set(CMAKE_LINKER ${CMAKE_SOURCE_DIR}/toolchain/inst/bin/sh-elf-ld) -set(CMAKE_C_LINK_EXECUTABLE "${CMAKE_SOURCE_DIR}/toolchain/inst/bin/sh-elf-gcc <OBJECTS> ${CMAKE_C_FLAGS} <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> -o <TARGET>") -+set(OBJCOPY /bin/sh-elf-objcopy) -+set(CMAKE_C_COMPILER "/bin/sh-elf-gcc") -+set(CMAKE_AR /bin/sh-elf-ar) -+set(CMAKE_ASM_COMPILER /bin/sh-elf-as) -+set(CMAKE_ASM-ATT_COMPILER /bin/sh-elf-as) -+set(CMAKE_LINKER /bin/sh-elf-ld) -+set(CMAKE_C_LINK_EXECUTABLE "/bin/sh-elf-gcc <OBJECTS> ${CMAKE_C_FLAGS} <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> -o <TARGET>") ++set(OBJCOPY /usr/bin/sh-elf-objcopy) ++set(CMAKE_C_COMPILER "/usr/bin/sh-elf-gcc") ++set(CMAKE_AR /usr/bin/sh-elf-ar) ++set(CMAKE_ASM_COMPILER /usr/bin/sh-elf-as) ++set(CMAKE_ASM-ATT_COMPILER /usr/bin/sh-elf-as) ++set(CMAKE_LINKER /usr/bin/sh-elf-ld) ++set(CMAKE_C_LINK_EXECUTABLE "/usr/bin/sh-elf-gcc <OBJECTS> ${CMAKE_C_FLAGS} <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> -o <TARGET>") set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -diff --git a/src/carl9170fw/toolchain/Makefile a/src/carl9170fw/toolchain/Makefile +diff --git a/src/carl9170fw/toolchain/Makefile b/src/carl9170fw/toolchain/Makefile deleted file mode 100644 index 3ee93a9..0000000 --- a/src/carl9170fw/toolchain/Makefile @@ -29527,7 +29654,7 @@ index 3ee93a9..0000000 - -distclean: clean - rm -rf "$(BASEDIR)/src" -diff --git a/src/carl9170fw/toolchain/SHA256SUMS a/src/carl9170fw/toolchain/SHA256SUMS +diff --git a/src/carl9170fw/toolchain/SHA256SUMS b/src/carl9170fw/toolchain/SHA256SUMS deleted file mode 100644 index 99505e4..0000000 --- a/src/carl9170fw/toolchain/SHA256SUMS @@ -29547,3 +29674,6 @@ index 99505e4..0000000 -67874a60826303ee2fb6affc6dc0ddd3e749e9bfcb4c8655e3953d0458a6e16e src/mpfr-4.0.1.tar.xz -6e46b8aeae2f727a36f0bd9505e405768a72218f1796f0d09757d45209871ae6 src/binutils-2.30.tar.xz - +-- +2.17.0 + diff --git a/libre/linux-libre-firmware/0002-carl9170fw-gcc-8-fix.patch b/libre/linux-libre-firmware/0002-carl9170fw-gcc-8-fix.patch new file mode 100644 index 000000000..c6ba04bb7 --- /dev/null +++ b/libre/linux-libre-firmware/0002-carl9170fw-gcc-8-fix.patch @@ -0,0 +1,95 @@ +From 81a2b8b073461b04616a739d6bc4ba77f02dfc1f Mon Sep 17 00:00:00 2001 +From: David P <megver83@parabola.nu> +Date: Fri, 4 May 2018 09:32:41 -0300 +Subject: [PATCH 2/2] carl9170fw gcc 8+ fix + +Mark certain structs/union aligned(4) to fix -Wpacked-not-aligned warnings on gcc 8+. + +Based on: https://github.com/chunkeey/carl9170fw/commit/b94cc57fa4ee29cb70415b699a1efc5f66eb41c7 + +Signed-off-by: David P <megver83@parabola.nu> +--- + src/carl9170fw/carlfw/include/dma.h | 4 ++-- + src/carl9170fw/include/shared/fwcmd.h | 2 +- + src/carl9170fw/include/shared/wlan.h | 12 ++++++------ + 3 files changed, 9 insertions(+), 9 deletions(-) + +diff --git a/src/carl9170fw/carlfw/include/dma.h b/src/carl9170fw/carlfw/include/dma.h +index 477c2a2..8141b1c 100644 +--- a/src/carl9170fw/carlfw/include/dma.h ++++ b/src/carl9170fw/carlfw/include/dma.h +@@ -73,12 +73,12 @@ struct carl9170_tx_ba_superframe { + struct ar9170_tx_null_frame { + struct ar9170_tx_hwdesc hdr; + struct ieee80211_hdr null; +-} __packed; ++} __packed __aligned(4); + + struct carl9170_tx_null_superframe { + struct carl9170_tx_superdesc s; + struct ar9170_tx_null_frame f; +-} __packed; ++} __packed __aligned(4); + + #define CARL9170_BA_BUFFER_LEN (__roundup(sizeof(struct carl9170_tx_ba_superframe), 16)) + #define CARL9170_RSP_BUFFER_LEN AR9170_BLOCK_SIZE +diff --git a/src/carl9170fw/include/shared/fwcmd.h b/src/carl9170fw/include/shared/fwcmd.h +index ea1d80f..2a58dd8 100644 +--- a/src/carl9170fw/include/shared/fwcmd.h ++++ b/src/carl9170fw/include/shared/fwcmd.h +@@ -240,7 +240,7 @@ struct carl9170_cmd { + struct carl9170_bcn_ctrl_cmd bcn_ctrl; + struct carl9170_rx_filter_cmd rx_filter; + u8 data[CARL9170_MAX_CMD_PAYLOAD_LEN]; +- } __packed; ++ } __packed __aligned(4); + } __packed __aligned(4); + + #define CARL9170_TX_STATUS_QUEUE 3 +diff --git a/src/carl9170fw/include/shared/wlan.h b/src/carl9170fw/include/shared/wlan.h +index ea17995..9c6b7ff 100644 +--- a/src/carl9170fw/include/shared/wlan.h ++++ b/src/carl9170fw/include/shared/wlan.h +@@ -370,24 +370,24 @@ struct ar9170_rx_frame_single { + struct ieee80211_hdr i3e; + struct ar9170_rx_phystatus phy_tail; + struct ar9170_rx_macstatus macstatus; +-} __packed; ++} __packed __aligned(4); + + struct ar9170_rx_frame_head { + struct ar9170_rx_head phy_head; + struct ieee80211_hdr i3e; + struct ar9170_rx_macstatus macstatus; +-} __packed; ++} __packed __aligned(4); + + struct ar9170_rx_frame_middle { + struct ieee80211_hdr i3e; + struct ar9170_rx_macstatus macstatus; +-} __packed; ++} __packed __aligned(4); + + struct ar9170_rx_frame_tail { + struct ieee80211_hdr i3e; + struct ar9170_rx_phystatus phy_tail; + struct ar9170_rx_macstatus macstatus; +-} __packed; ++} __packed __aligned(4); + + struct ar9170_rx_frame { + union { +@@ -395,8 +395,8 @@ struct ar9170_rx_frame { + struct ar9170_rx_frame_head head; + struct ar9170_rx_frame_middle middle; + struct ar9170_rx_frame_tail tail; +- } __packed; +-} __packed; ++ } __packed __aligned(4); ++} __packed __aligned(4); + + static inline u8 ar9170_get_decrypt_type(struct ar9170_rx_macstatus *t) + { +-- +2.17.0 + diff --git a/libre/linux-libre-firmware/PKGBUILD b/libre/linux-libre-firmware/PKGBUILD index 3597f2c41..e0ec3fb91 100644 --- a/libre/linux-libre-firmware/PKGBUILD +++ b/libre/linux-libre-firmware/PKGBUILD @@ -5,13 +5,13 @@ pkgname=linux-libre-firmware pkgver=1.2 -pkgrel=1 +pkgrel=2 epoch=1 pkgdesc='Firmware files for Linux-libre' arch=('any') url='https://jxself.org/firmware' license=('GPL3' 'GPL2') -makedepends=('cmake' 'gmp' 'gperf' 'arm-linux-gnueabi-gcc' 'sh-elf-gcc' 'sh-elf-newlib' 'xtensa-unknown-elf-gcc') +makedepends=('cmake' 'arm-linux-gnueabi-gcc' 'sh-elf-gcc' 'sh-elf-newlib' 'xtensa-elf-gcc') provides=('linux-firmware') conflicts=('linux-firmware' 'linux-firmware-git' @@ -31,23 +31,22 @@ conflicts=('linux-firmware' 'ath9k-htc-firmware') replaces=(${conflicts[@]}) options=(!strip) -source=("${url}/${pkgname}-${pkgver}.tar.lz"{,.asc} - 'remove-wget.patch' # remove the download of external toolchains -) +source=("${url}/${pkgname}-${pkgver}.tar.lz"{,.asc} '0001-remove-external-toolchains.patch' '0002-carl9170fw-gcc-8-fix.patch') sha512sums=('2f70207ae7a98a71b74950a909e899c58617e46693a4b069cd16de1b2f0bb31c6abb07c0f4db88b5cecc3f3c50da56265da0b771c58b164981d628231f130387' 'SKIP' - 'b5327fb56c1881f2eb834181a5a22df3ec08f90cccef3a71f7b194b845cb2610f7c1a7d8d7b9d8194959938a1c4bec613da6e8311cef57c7379be8964c9997d9') + 'cc3417dcf165442260b509facc391fcce9125befea26c22b0748715484ab2373c56e5fa6e306ff74c1f39baccf8f5a0aee067d444d5980796e9d2c6fa6179fe5' + 'f1326f1af1586b39ca738ff9c263c5ac1388996914cbab9898adac3430dba2b28fecc5495ab624b098c853cc9795b646d0ca631b696413db14d7f4a47b4a2374') validpgpkeys=('F611A908FFA165C699584ED49D0DB31B545A3198') # Jason Self prepare() { cd $srcdir/$pkgname-$pkgver - # Some firmwares download toolchains with wget. We don't want that - patch -p1 -i ../remove-wget.patch + # do not download toolchains so we can build offline + patch -p1 -i ../0001-remove-external-toolchains.patch + + # fix building with GCC 8+ + patch -p1 -i ../0002-carl9170fw-gcc-8-fix.patch - # CARL9170 configuration - sed -e '13s|config/conf|config/conf --alldefconfig|' \ - -i src/carl9170fw/autogen.sh } build() { |