Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
vidplace7 committed Dec 29, 2024
1 parent 295331a commit 29808af
Show file tree
Hide file tree
Showing 23 changed files with 1,104 additions and 0 deletions.
90 changes: 90 additions & 0 deletions .github/workflows/multi-arch-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Multi arch build packages

on:
push:
branches:
- main
- openwrt-24.10
- openwrt-23.05
paths:
- '.github/workflows/multi-arch-build.yml'
- '**/Makefile'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
name: build ${{ matrix.arch }} ${{ github.ref_name }}
runs-on: ubuntu-24.04
strategy:
fail-fast: false
max-parallel: 1
matrix:
arch:
- aarch64_cortex-a53
- aarch64_cortex-a72
- aarch64_generic
- arm_arm1176jzf-s_vfp
- arm_arm926ej-s
- arm_cortex-a15_neon-vfpv4
- arm_cortex-a5_vfpv4
- arm_cortex-a7
- arm_cortex-a7_neon-vfpv4
- arm_cortex-a7_vfpv4
- arm_cortex-a8_vfpv3
- arm_cortex-a9
- arm_cortex-a9_neon
- arm_cortex-a9_vfpv3-d16
- arm_fa526
# - arm_mpcore # Fails to create index?
- arm_xscale
- i386_pentium-mmx
- i386_pentium4
- mips64_octeonplus
- mips_24kc
- mips_4kec
- mips_mips32
- mipsel_24kc
- mipsel_24kc_24kf
- mipsel_74kc
- mipsel_mips32
- powerpc64_e5500
- powerpc_464fp
- powerpc_8548
- riscv64_riscv64
- x86_64

steps:
- uses: actions/checkout@v4

- name: Build APK packages ${{ matrix.arch }}
if: ${{ github.ref_name == 'main' }}
# uses: openwrt/gh-action-sdk@main # Switch back when https://github.com/openwrt/gh-action-sdk/pull/46 is merged
uses: morytyann/gh-action-sdk@9f25772dff4788550a51688423f8f308d061025d
env:
ARCH: "${{ matrix.arch }}-${{ github.ref_name }}"
FEEDNAME: "meshtastic"
IGNORE_ERRORS: "n m y"
PRIVATE_KEY: "${{ secrets.WRT_APK_KEY }}"
INDEX: 1

- name: Build IPK packages ${{ matrix.arch }}
if: ${{ github.ref_name != 'main' }}
uses: openwrt/gh-action-sdk@main
env:
ARCH: "${{ matrix.arch }}-${{ github.ref_name }}"
FEEDNAME: "meshtastic"
IGNORE_ERRORS: "n m y"
KEY_BUILD: "${{ secrets.WRT_IPK_KEY }}"
INDEX: 1

- name: Upload packages to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
deploy_key: ${{ secrets.WRT_REPO_DEPLOY_KEY }}
external_repository: meshtastic/openwrt-repo
publish_dir: bin/packages/${{ matrix.arch }}/meshtastic/
destination_dir: ${{ github.ref_name }}/${{ matrix.arch }}
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
9 changes: 9 additions & 0 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: PR Test build

on:
pull_request:

jobs:
build:
name: Test Build
uses: openwrt/actions-shared-workflows/.github/workflows/multi-arch-test-build.yml@main
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Meshtastic OpenWRT
Meshtastic Packages for OpenWRT
56 changes: 56 additions & 0 deletions depends/abseil-cpp/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=abseil-cpp
PKG_VERSION:=20240722.0
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/abseil/abseil-cpp/releases/download/$(PKG_VERSION)
PKG_HASH:=f50e5ac311a81382da7fa75b97310e4b9006474f9560ac46f54a9967f07d4ae3

PKG_MAINTAINER:=Austin Lane <[email protected]>
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=LICENSE

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/cmake.mk

define Package/abseil-cpp
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Collection of C++ code designed to augment the C++ standard library
URL:=https://github.com/abseil/abseil-cpp
DEPENDS:=+libpthread +libstdcpp
endef

define Package/abseil-cpp/description
Abseil is an open-source collection of C++ code (compliant to C++14) designed to augment the C++ standard library.
endef

CMAKE_INSTALL:=1

CMAKE_HOST_OPTIONS += \
-DCMAKE_CXX_STANDARD=14 \
-DABSL_ENABLE_INSTALL=ON \
-DABSL_USE_GOOGLETEST_HEAD=OFF

CMAKE_OPTIONS += \
-DCMAKE_CXX_STANDARD=14 \
-DABSL_ENABLE_INSTALL=ON \
-DABSL_USE_GOOGLETEST_HEAD=OFF

TARGET_CFLAGS += $(FPIC)

define Build/InstallDev
$(call Build/InstallDev/cmake,$(1))
$(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/absl_*.pc
$(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/absl_*.pc
endef

$(eval $(call BuildPackage,abseil-cpp))
$(eval $(call HostBuild))
34 changes: 34 additions & 0 deletions depends/abseil-cpp/patches/001-absl-always-use-asm-sgidefs.h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# From https://git.openembedded.org/meta-openembedded/tree/meta-oe/recipes-devtools/abseil-cpp
From 11faa06436fdeb0c9948080a11f9a99d3b5ba16c Mon Sep 17 00:00:00 2001
From: Khem Raj <[email protected]>
Date: Thu, 9 Apr 2020 13:06:27 -0700
Subject: [PATCH] absl: always use <asm/sgidefs.h>

Fixes mips/musl build, since sgidefs.h is not present on all C libraries
but on linux asm/sgidefs.h is there and contains same definitions, using
that makes it portable.

Upstream-Status: Pending

Signed-off-by: Khem Raj <[email protected]>
---
absl/base/internal/direct_mmap.h | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

--- a/absl/base/internal/direct_mmap.h
+++ b/absl/base/internal/direct_mmap.h
@@ -41,13 +41,9 @@

#ifdef __mips__
// Include definitions of the ABI currently in use.
-#if defined(__BIONIC__) || !defined(__GLIBC__)
-// Android doesn't have sgidefs.h, but does have asm/sgidefs.h, which has the
+// bionic/musl C libs don't have sgidefs.h, but do have asm/sgidefs.h, which has the
// definitions we need.
#include <asm/sgidefs.h>
-#else
-#include <sgidefs.h>
-#endif // __BIONIC__ || !__GLIBC__
#endif // __mips__

// SYS_mmap and SYS_munmap are not defined in Android.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# From https://git.openembedded.org/meta-openembedded/tree/meta-oe/recipes-devtools/abseil-cpp
From a573ccd57e713486e7d8e782d6b3b34fde01ff9e Mon Sep 17 00:00:00 2001
From: Sinan Kaya <[email protected]>
Date: Mon, 3 Feb 2020 03:25:57 +0000
Subject: [PATCH] Remove maes option from cross-compilation

Upstream-Status: Pending
---
absl/copts/GENERATED_AbseilCopts.cmake | 4 ----
absl/copts/GENERATED_copts.bzl | 4 ----
2 files changed, 8 deletions(-)

--- a/absl/copts/GENERATED_AbseilCopts.cmake
+++ b/absl/copts/GENERATED_AbseilCopts.cmake
@@ -229,7 +229,3 @@ list(APPEND ABSL_RANDOM_HWAES_ARM64_FLAG
list(APPEND ABSL_RANDOM_HWAES_MSVC_X64_FLAGS
)

-list(APPEND ABSL_RANDOM_HWAES_X64_FLAGS
- "-maes"
- "-msse4.1"
-)
--- a/absl/copts/GENERATED_copts.bzl
+++ b/absl/copts/GENERATED_copts.bzl
@@ -230,7 +230,3 @@ ABSL_RANDOM_HWAES_ARM64_FLAGS = [
ABSL_RANDOM_HWAES_MSVC_X64_FLAGS = [
]

-ABSL_RANDOM_HWAES_X64_FLAGS = [
- "-maes",
- "-msse4.1",
-]
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# From https://git.openembedded.org/meta-openembedded/tree/meta-oe/recipes-devtools/abseil-cpp
From 632632508daf8bb3a5800dac937ffc33c6d85973 Mon Sep 17 00:00:00 2001
From: Jonas Gorski <[email protected]>
Date: Thu, 16 Jun 2022 11:46:31 +0000
Subject: [PATCH] Remove neon option from cross compilation

Not every arm platform supports neon instructions, so do not enforce
them.

Upstream-Status: Pending

Signed-off-by: Jonas Gorski <[email protected]>
---
absl/copts/GENERATED_AbseilCopts.cmake | 4 ----
absl/copts/GENERATED_copts.bzl | 4 ----
2 files changed, 8 deletions(-)

--- a/absl/copts/GENERATED_AbseilCopts.cmake
+++ b/absl/copts/GENERATED_AbseilCopts.cmake
@@ -218,10 +218,6 @@ list(APPEND ABSL_MSVC_TEST_FLAGS
"/DNOMINMAX"
)

-list(APPEND ABSL_RANDOM_HWAES_ARM32_FLAGS
- "-mfpu=neon"
-)
-
list(APPEND ABSL_RANDOM_HWAES_ARM64_FLAGS
"-march=armv8-a+crypto"
)
--- a/absl/copts/GENERATED_copts.bzl
+++ b/absl/copts/GENERATED_copts.bzl
@@ -219,10 +219,6 @@ ABSL_MSVC_TEST_FLAGS = [
"/DNOMINMAX",
]

-ABSL_RANDOM_HWAES_ARM32_FLAGS = [
- "-mfpu=neon",
-]
-
ABSL_RANDOM_HWAES_ARM64_FLAGS = [
"-march=armv8-a+crypto",
]
93 changes: 93 additions & 0 deletions depends/abseil-cpp/patches/004-abseil-ppc-fixes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# From https://git.openembedded.org/meta-openembedded/tree/meta-oe/recipes-devtools/abseil-cpp
From f9607924225ca59fb6c60222e6424b84e6f70029 Mon Sep 17 00:00:00 2001
From: Khem Raj <[email protected]>
Date: Sat, 21 Sep 2024 20:53:06 +0800
Subject: [PATCH] abseil: ppc fixes

An all-in-one patch that fixes several issues:

1) UnscaledCycleClock not fully implemented for ppc*-musl (disabled on musl)
2) powerpc stacktrace implementation only works on glibc (disabled on musl)
3) powerpc stacktrace implementation has ppc64 assumptions (fixed)
4) examine_stack.cpp makes glibc assumptions on powerpc (fixed)

Sourced from void linux

Upstream-Status: Pending

Signed-off-by: Khem Raj <[email protected]>
---
absl/base/internal/unscaledcycleclock.cc | 4 ++--
absl/base/internal/unscaledcycleclock_config.h | 3 ++-
absl/debugging/internal/examine_stack.cc | 8 +++++++-
absl/debugging/internal/stacktrace_config.h | 2 +-
4 files changed, 12 insertions(+), 5 deletions(-)

--- a/absl/base/internal/unscaledcycleclock.cc
+++ b/absl/base/internal/unscaledcycleclock.cc
@@ -20,7 +20,7 @@
#include <intrin.h>
#endif

-#if defined(__powerpc__) || defined(__ppc__)
+#if (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
#ifdef __GLIBC__
#include <sys/platform/ppc.h>
#elif defined(__FreeBSD__)
@@ -58,7 +58,7 @@ double UnscaledCycleClock::Frequency() {
return base_internal::NominalCPUFrequency();
}

-#elif defined(__powerpc__) || defined(__ppc__)
+#elif (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)

int64_t UnscaledCycleClock::Now() {
#ifdef __GLIBC__
--- a/absl/base/internal/unscaledcycleclock_config.h
+++ b/absl/base/internal/unscaledcycleclock_config.h
@@ -21,7 +21,8 @@

// The following platforms have an implementation of a hardware counter.
#if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \
- defined(__powerpc__) || defined(__ppc__) || defined(_M_IX86) || \
+ ((defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)) || \
+ defined(_M_IX86) || \
(defined(_M_X64) && !defined(_M_ARM64EC))
#define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1
#else
--- a/absl/debugging/internal/examine_stack.cc
+++ b/absl/debugging/internal/examine_stack.cc
@@ -36,6 +36,10 @@
#include <csignal>
#include <cstdio>

+#if defined(__powerpc__)
+#include <asm/ptrace.h>
+#endif
+
#include "absl/base/attributes.h"
#include "absl/base/internal/raw_logging.h"
#include "absl/base/macros.h"
@@ -177,8 +181,10 @@ void* GetProgramCounter(void* const vuc)
return reinterpret_cast<void*>(context->uc_mcontext.pc);
#elif defined(__powerpc64__)
return reinterpret_cast<void*>(context->uc_mcontext.gp_regs[32]);
-#elif defined(__powerpc__)
+#elif defined(__powerpc__) && defined(__GLIBC__)
return reinterpret_cast<void*>(context->uc_mcontext.uc_regs->gregs[32]);
+#elif defined(__powerpc__)
+ return reinterpret_cast<void*>((context->uc_regs)->gregs[32]);
#elif defined(__riscv)
return reinterpret_cast<void*>(context->uc_mcontext.__gregs[REG_PC]);
#elif defined(__s390__) && !defined(__s390x__)
--- a/absl/debugging/internal/stacktrace_config.h
+++ b/absl/debugging/internal/stacktrace_config.h
@@ -60,7 +60,7 @@
#elif defined(__i386__) || defined(__x86_64__)
#define ABSL_STACKTRACE_INL_HEADER \
"absl/debugging/internal/stacktrace_x86-inl.inc"
-#elif defined(__ppc__) || defined(__PPC__)
+#elif (defined(__ppc__) || defined(__PPC__)) && defined(__GLIBC__)
#define ABSL_STACKTRACE_INL_HEADER \
"absl/debugging/internal/stacktrace_powerpc-inl.inc"
#elif defined(__aarch64__)
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# From https://git.openembedded.org/meta-openembedded/tree/meta-oe/recipes-devtools/abseil-cpp
From 9cb5e5d15c142e5cc43a2c1db87c8e4e5b6d38a5 Mon Sep 17 00:00:00 2001
From: Derek Mauro <[email protected]>
Date: Mon, 5 Aug 2024 07:35:05 -0700
Subject: [PATCH] Don't match -Wnon-virtual-dtor in the "flags are needed to
suppress warnings in headers". It should fall through to the "don't impose
our warnings on others" case. Do this by matching on "-Wno-*" instead of
"-Wno*".

Fixes #1737

PiperOrigin-RevId: 659548798
Change-Id: I49d7ba7ddcd7be30f946fca90ba9be467181e854
Upstream-Status: Backport [https://github.com/abseil/abseil-cpp/commit/9cb5e5d15c142e5cc43a2c1db87c8e4e5b6d38a5]
---
CMake/AbseilHelpers.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/CMake/AbseilHelpers.cmake
+++ b/CMake/AbseilHelpers.cmake
@@ -195,7 +195,7 @@ function(absl_cc_library)
# specified platform. Filter both of them out before the successor
# reaches the "^-m" filter.
set(skip_next_cflag ON)
- elseif(${cflag} MATCHES "^(-Wno|/wd)")
+ elseif(${cflag} MATCHES "^(-Wno-|/wd)")
# These flags are needed to suppress warnings that might fire in our headers.
set(PC_CFLAGS "${PC_CFLAGS} ${cflag}")
elseif(${cflag} MATCHES "^(-W|/w[1234eo])")
Loading

0 comments on commit 29808af

Please sign in to comment.