Skip to content

Commit

Permalink
[no ci] General: set toolchain name based on chipset family (#1612)
Browse files Browse the repository at this point in the history
  • Loading branch information
viktorxda authored Nov 21, 2024
1 parent 1c5f0e9 commit d6c4b42
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 36 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ env:
SIGMASTAR: ssc30kd ssc30kq ssc325 ssc333 ssc335 ssc335de ssc337 ssc337de ssc338q ssc377 ssc377d ssc377de ssc378de
INGENIC: t10 t10l t20 t20l t20x t21n t30a t30a1 t30l t30n t30x t31a t31al t31l t31lc t31n t31x
ALLWINNER: v851s
TAG_NAME: image

jobs:
toolchain:
Expand All @@ -20,9 +21,9 @@ jobs:
create() {
uboot=u-boot-$1-nor.bin
firmware=openipc.$2-nor-$3.tgz
release=images/openipc-$1-nor-$3.bin
release=image/openipc-$1-nor-$3.bin
mkdir -p images output
mkdir -p image output
if ! wget -nv $link/$uboot -O output/$1.bin; then
echo -e "Download failed: $link/$uboot\n"
return 0
Expand Down Expand Up @@ -56,6 +57,6 @@ jobs:
- name: Upload
uses: softprops/action-gh-release@v2
with:
tag_name: images
tag_name: ${{env.TAG_NAME}}
make_latest: false
files: images/*.bin
files: image/*.bin
10 changes: 3 additions & 7 deletions .github/workflows/toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
workflow_dispatch:

env:
TAG_NAME: latest
TAG_NAME: toolchain

jobs:
toolchain:
Expand All @@ -26,9 +26,6 @@ jobs:
# Ingenic [T31]
- {"platform": "t31"}

# Ingenic [T31] with GLIBC
- {"platform": "t31glibc"}

# Ingenic [T40]
- {"platform": "t40"}

Expand Down Expand Up @@ -84,11 +81,9 @@ jobs:
URL=https://github.com/${GITHUB_REPOSITORY}/releases/download/${TAG_NAME}/${GCC}
echo ${URL}
if ! wget -q --spider ${URL}; then
sed -i "/BR2_TOOLCHAIN_EXTERNAL.*/d" ${CONFIG}
echo BR2_PACKAGE_HOST_GDB=y >> ${CONFIG}
echo BR2_PACKAGE_AWS_WEBRTC=y >> ${CONFIG}
make BOARD=${CONFIG} br-source
make BOARD=${CONFIG} br-sdk
make BOARD=${CONFIG} toolchain
SDK=$(find output/images -name *_sdk-buildroot.tar.gz)
mv ${SDK} ${GCC}
echo GCC=${GCC} >> ${GITHUB_ENV}
Expand All @@ -98,4 +93,5 @@ jobs:
uses: softprops/action-gh-release@v2
with:
tag_name: ${{env.TAG_NAME}}
make_latest: false
files: ${{env.GCC}}
14 changes: 11 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ BR_VER = 2024.02.6
BR_MAKE = $(MAKE) -C $(TARGET)/buildroot-$(BR_VER) BR2_EXTERNAL=$(PWD)/general O=$(TARGET)
BR_LINK = https://github.com/buildroot/buildroot/archive
BR_FILE = /tmp/buildroot-$(BR_VER).tar.gz
BR_CONF = $(TARGET)/openipc_defconfig
TARGET ?= $(PWD)/output

CONFIG = $(error variable BOARD not defined)
Expand Down Expand Up @@ -29,8 +30,8 @@ br-%: defconfig

defconfig: prepare
@echo --- $(or $(CONFIG),$(error variable BOARD not found))
@cat $(CONFIG) $(PWD)/general/openipc.fragment > $(TARGET)/openipc_defconfig
@$(BR_MAKE) BR2_DEFCONFIG=$(TARGET)/openipc_defconfig defconfig
@cat $(CONFIG) $(PWD)/general/openipc.fragment > $(BR_CONF)
@$(BR_MAKE) BR2_DEFCONFIG=$(BR_CONF) defconfig

prepare:
@if test ! -e $(TARGET)/buildroot-$(BR_VER); then \
Expand All @@ -53,7 +54,7 @@ package:
@find $(PWD)/general/package/* -maxdepth 0 -type d -printf "br-%f\n" | grep -v patch

toolname:
@$(PWD)/general/scripts/show_toolchains.sh $(CONFIG)
@echo br-sdk-$(BR2_OPENIPC_SOC_VENDOR)-$(BR2_OPENIPC_SOC_FAMILY)

clean:
@rm -rf $(TARGET)/build $(TARGET)/images $(TARGET)/per-package $(TARGET)/target
Expand All @@ -68,6 +69,13 @@ deps:
timer:
@echo - Build time: $(shell date -d @$(shell expr $(shell date +%s) - $(TIMER)) -u +%M:%S)

toolchain: defconfig
ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
@$(MAKE) -f $(PWD)/general/toolchain.mk BR_CONF=$(BR_CONF) CONFIG=$(PWD)/$(CONFIG)
@$(BR_MAKE) BR2_DEFCONFIG=$(BR_CONF) defconfig
endif
@$(BR_MAKE) sdk

repack:
ifeq ($(BR2_TARGET_ROOTFS_SQUASHFS),y)
ifeq ($(BR2_OPENIPC_FLASH_SIZE),"8")
Expand Down
1 change: 0 additions & 1 deletion br-ext-chip-grainmedia/configs/gm8135_lite_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ BR2_arm=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
BR2_TOOLCHAIN_EXTERNAL_UCLIBC=y
BR2_TOOLCHAIN_EXTERNAL_URL="https://github.com/openipc/firmware/releases/download/$(OPENIPC_TOOLCHAIN).tgz"
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="arm-openipc-linux-uclibcgnueabi"
BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_3=y
Expand Down
1 change: 0 additions & 1 deletion br-ext-chip-grainmedia/configs/gm8136_lite_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ BR2_arm=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
BR2_TOOLCHAIN_EXTERNAL_UCLIBC=y
BR2_TOOLCHAIN_EXTERNAL_URL="https://github.com/openipc/firmware/releases/download/$(OPENIPC_TOOLCHAIN).tgz"
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="arm-openipc-linux-uclibcgnueabi"
BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_3=y
Expand Down
2 changes: 1 addition & 1 deletion general/external.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export OPENIPC_MAJESTIC := $(call qstrip,$(BR2_OPENIPC_MAJESTIC))
export WGET := wget --show-progress --passive-ftp -nd -t5 -T10

EXTERNAL_VENDOR := $(BR2_EXTERNAL)/../br-ext-chip-$(OPENIPC_SOC_VENDOR)
OPENIPC_TOOLCHAIN := latest/$(shell $(BR2_EXTERNAL)/scripts/show_toolchains.sh $(BR2_DEFCONFIG))
OPENIPC_KERNEL := $(OPENIPC_SOC_VENDOR)-$(OPENIPC_SOC_FAMILY)
OPENIPC_TOOLCHAIN := toolchain/br-sdk-$(OPENIPC_KERNEL)

include $(sort $(wildcard $(BR2_EXTERNAL)/package/*/*.mk))
19 changes: 0 additions & 19 deletions general/scripts/show_toolchains.sh

This file was deleted.

36 changes: 36 additions & 0 deletions general/toolchain.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
include $(CONFIG)

all:
@echo -e "\n# SDK" >> $(BR_CONF)
@echo "BR2_TOOLCHAIN_BUILDROOT=y" >> $(BR_CONF)
@echo "BR2_TOOLCHAIN_BUILDROOT_VENDOR=\"openipc\"" >> $(BR_CONF)
ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL),y)
@echo "BR2_TOOLCHAIN_BUILDROOT_MUSL=y" >> $(BR_CONF)
else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC),y)
@echo "BR2_TOOLCHAIN_BUILDROOT_GLIBC=y" >> $(BR_CONF)
else
@echo "BR2_TOOLCHAIN_BUILDROOT_UCLIBC=y" >> $(BR_CONF)
endif
ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CXX),y)
@echo "BR2_TOOLCHAIN_BUILDROOT_CXX=y" >> $(BR_CONF)
endif
ifeq ($(BR2_TOOLCHAIN_EXTERNAL_HEADERS_5_10),y)
@echo "BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y" >> $(BR_CONF)
else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_19),y)
@echo "BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y" >> $(BR_CONF)
else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_9),y)
@echo "BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9=y" >> $(BR_CONF)
else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_4),y)
@echo "BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_4=y" >> $(BR_CONF)
else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_18),y)
@echo "BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_18=y" >> $(BR_CONF)
else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_10),y)
@echo "BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_10=y" >> $(BR_CONF)
else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_4),y)
@echo "BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_4=y" >> $(BR_CONF)
else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_3),y)
@echo "BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_3=y" >> $(BR_CONF)
else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_0),y)
@echo "BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_0=y" >> $(BR_CONF)
endif
@echo "BR2_GCC_VERSION_13_X=y" >> $(BR_CONF)

0 comments on commit d6c4b42

Please sign in to comment.