adding a few recipes (not working: libunwind, elfutils)

master
Philippe Pittoli 2021-03-15 18:29:56 +01:00
parent 47f7b87b14
commit 6e585cedcf
25 changed files with 8983 additions and 0 deletions

19
recipes/binutils/Makefile Normal file
View File

@ -0,0 +1,19 @@
name = binutils
version = 2.36
release = 0
URL = https://ftp.gnu.org/gnu/binutils/binutils-$(version).tar.xz
dependencies = flex
CONFIGURE_OPTIONS_USER = --disable-multilib --with-pic --disable-nls
MAKE_OPTIONS_USER = tooldir=$(PREFIX)
MAKE_INSTALL_OPTIONS_USER = tooldir=$(PREFIX)
SYSCONF ?= ../../
include $(SYSCONF)/package.mk
# Not sure why.
post_fake_root_install:
rm $(pkg_fake_root_dir)/$(PREFIX)/bin/strings
.PHONY: # all clean distclean dist install uninstall help

6
recipes/bison/Makefile Normal file
View File

@ -0,0 +1,6 @@
name = bison
version = 3.7.6
URL = https://ftp.gnu.org/gnu/bison/bison-$(version).tar.xz
SYSCONF ?= ../../
include $(SYSCONF)/package.mk

30
recipes/curl/Makefile Normal file
View File

@ -0,0 +1,30 @@
name = curl
version = 7.75.0
release = 0
URL = https://curl.haxx.se/download/curl-$(version).tar.gz
# build-dependencies = make openssl-dev
build-dependencies = make libressl-dev
CONFIGURE_OPTIONS_USER = --prefix="$(PREFIX)" \
--enable-ipv6 \
--enable-unix-sockets \
--enable-static \
--enable-openssl \
--without-libidn \
--without-libidn2 \
--with-nghttp2 \
--disable-ldap \
--with-pic \
--without-libssh2 # https://bugs.alpinelinux.org/issues/10222
SYSCONF ?= ../../
include $(SYSCONF)/package.mk
configure_cmake:
@true
pre_build:
mkdir -p $(pkg_fake_root_dir)/etc/ssl/certs/
cp ca-certificates.crt $(pkg_fake_root_dir)/etc/ssl/certs/

File diff suppressed because it is too large Load Diff

21
recipes/elfutils/Makefile Normal file
View File

@ -0,0 +1,21 @@
name = elfutils
version = 0.183
release = 0
URL = https://sourceware.org/elfutils/ftp/$(version)/elfutils-$(version).tar.bz2
dependencies = argp-standalone fts
build-dependencies = musl-obstack-dev musl-libintl
#
# TODO: this recipe doesn't compile (missing the 'error.h' header)
#
CC=gcc
CONFIGURE_OPTIONS_USER = --target=$(ARCH)-baguette-linux-musl \
--build=$(ARCH)-baguette-linux-musl \
--host=$(ARCH)-baguette-linux-musl \
--disable-libdebuginfod --disable-debuginfod
SYSCONF ?= ../../
include $(SYSCONF)/package.mk

1
recipes/elfutils/README Normal file
View File

@ -0,0 +1 @@
# TODO: this recipe doesn't compile (missing the 'error.h' header)

10
recipes/flex/Makefile Normal file
View File

@ -0,0 +1,10 @@
name = flex
version = 2.6.4
release = 0
URL = https://github.com/westes/flex/files/981163/flex-$(version).tar.gz
SYSCONF ?= ../../
include $(SYSCONF)/package.mk
build-dependencies = make

12
recipes/gc/Makefile Normal file
View File

@ -0,0 +1,12 @@
name = gc
version = 8.0.4
release = 0
URL = https://github.com/ivmai/bdwgc/releases/download/v$(version)/gc-$(version).tar.gz
CONFIGURE_OPTIONS_USER = --enable-static
SYSCONF ?= ../../
include $(SYSCONF)/package.mk
configure_cmake:
@true

36
recipes/git/Makefile Normal file
View File

@ -0,0 +1,36 @@
name = git
version = 2.31.0
release = 3
URL = https://mirrors.edge.kernel.org/pub/software/scm/git/$(name)-$(version).tar.xz
build-dependencies = curl \
libressl-dev \
perl \
autoconf \
automake \
zlib-dev \
gettext
dependencies = binutils
# Force JOBS=1, git cannot be built otherwise.
JOBS = 1
# -i prevents the use of gettext (msgfmt)
MAKE_OPTIONS_USER = -i
MAKE_INSTALL_OPTIONS_USER = -i
CONFIGURE_OPTIONS_USER = --prefix=$(PREFIX) \
--with-curl --enable-openssl \
--without-tcltk --disable-nls
SYSCONF ?= ../../
include $(SYSCONF)/package.mk
pre_configure:
$(Q)[ -f $(bdir)/configure ] && ( \
cd $(bdir) ; \
make distclean ; \
autoconf ; \
)

View File

@ -0,0 +1,81 @@
name = libarchive
version = 3.5.1
release = 0
URL = https://www.libarchive.org/downloads/libarchive-$(version).tar.gz
build-dependencies = xz-dev zlib-static bzip2-static lzo-dev zstd-static
#build-dependencies = xz-dev zlib-dev bzip2-dev lzo-dev zstd-dev
dependencies = xz zlib bzip2 lzo zstd
CONFIGURE_OPTIONS_USER = --with-zlib --with-lzo2 --with-lzma --with-bz2lib --with-zstd \
--without-cng --without-nettle --without-expat --without-xml2 \
--without-openssl \
--enable-posix-regex-lib=libc \
LDFLAGS="-L$(PREFIX)/lib -static"
SYSCONF ?= ../../
include $(SYSCONF)/package.mk
configure_cmake:
@true
pre_fake_root_install:
@echo -e "\033[0;37;40m>> pre-fake-root-install, statically compile bsd(tar|cpio|cat)\033[0m"
cd $(bdir); \
for i in tar cpio cat; do \
$(CC) -static -o bsd$${i} $${i}/*.o \
.libs/libarchive.a .libs/libarchive_fe.a \
-llzma -lzstd -lz -lbz2 ;\
done
# FIXME: Well want to use those as default `tar`, `cpio` and `zcat`
# implementations in the future.
pkg_bsdtar = $(repository_directory)/$(ARCH)/$(name)-bsdtar-$(version)-r$(release).apk
fr_bsdtar = $(pkg_fake_root_dir)-bsdtar
split_bsdtar: $(pkg_bsdtar)
$(pkg_bsdtar):
@echo "Packaging $@"
mkdir -p $(fr_bsdtar)/$(PREFIX)/bin
cp $(pkg_fake_root_dir)/$(PREFIX)/bin/bsdtar $(fr_bsdtar)/$(PREFIX)/bin/bsdtar
$(Q)if [ -d "$(fr_bsdtar)" ]; then \
cd $(fr_bsdtar) ; \
dependencies="libarchive" conflicts="" provides="cmd:bsdtar" create-package $@ \
>> $(log_file).info 2>> $(log_file).err ; \
else \
echo "\033[1;35;40m>> Error: no '$(fr_bsdtar)' directory\033[0m"; \
exit 1; \
fi
pkg_bsdcpio = $(repository_directory)/$(ARCH)/$(name)-bsdcpio-$(version)-r$(release).apk
fr_bsdcpio = $(pkg_fake_root_dir)-bsdcpio
split_bsdcpio: $(pkg_bsdcpio)
$(pkg_bsdcpio):
@echo "Packaging $@"
mkdir -p $(fr_bsdcpio)/$(PREFIX)/bin
cp $(pkg_fake_root_dir)/$(PREFIX)/bin/bsdcpio $(fr_bsdcpio)/$(PREFIX)/bin/bsdcpio
$(Q)if [ -d "$(fr_bsdcpio)" ]; then \
cd $(fr_bsdcpio) ; \
dependencies="libarchive" conflicts="" provides="cmd:bsdcpio" create-package $@ \
>> $(log_file).info 2>> $(log_file).err ; \
else \
echo "\033[1;35;40m>> Error: no '$(fr_bsdcpio)' directory\033[0m"; \
exit 1; \
fi
pkg_bsdcat = $(repository_directory)/$(ARCH)/$(name)-bsdcat-$(version)-r$(release).apk
fr_bsdcat = $(pkg_fake_root_dir)-bsdcat
split_bsdcat: $(pkg_bsdcat)
$(pkg_bsdcat):
@echo "Packaging $@"
mkdir -p $(fr_bsdcat)/$(PREFIX)/bin
cp $(pkg_fake_root_dir)/$(PREFIX)/bin/bsdcat $(fr_bsdcat)/$(PREFIX)/bin/bsdcat
$(Q)if [ -d "$(fr_bsdcat)" ]; then \
cd $(fr_bsdcat) ; \
dependencies="libarchive" conflicts="" provides="cmd:bsdcat" create-package $@ \
>> $(log_file).info 2>> $(log_file).err ; \
else \
echo "\033[1;35;40m>> Error: no '$(fr_bsdcat)' directory\033[0m"; \
exit 1; \
fi
splits: split_bsdcat split_bsdtar split_bsdcpio

17
recipes/libargp/Makefile Normal file
View File

@ -0,0 +1,17 @@
name = libargp
version = 1.3-1
release = 0
URL = https://github.com/amylum/libargp/releases/download/$(version)/libargp.tar.gz
SYSCONF ?= ../../
include $(SYSCONF)/package.mk
configure:
@echo -e "\033[0;37;45m'configure' operation only copies static files\033[0m"
cp -r $(pkg_build_par_dir)/* $(pkg_fake_root_dir)/
build:
@echo -e "\033[0;37;45m'build' operation does nothing\033[0m"
fake_root_install:
@echo -e "\033[0;37;45m'fake_root_install' operation does nothing\033[0m"

View File

@ -0,0 +1,29 @@
name = libunwind
version = 1.5.0
URL = https://download.savannah.nongnu.org/releases/libunwind/libunwind-$(version).tar.gz
description = "Portable and efficient C programming interface (API) to determine the call-chain of a program"
website = "https://www.nongnu.org/libunwind/"
license="MIT"
build-dependencies = autoconf automake libtool linux-headers xz-dev libucontext-dev
patches = force-enable-man.patch \
musl-mips-fix.patch \
ppc64-musl.patch \
fix-ppc64-libdir.patch \
fix-libunwind-pc-in.patch
pre_configure:
@cd $(bdir) && autoreconf -fi
LDFLAGS = $(LDFLAGS) -lucontext
CFLAGS = $(CFLAGS) -fno-stack-protector
CONFIGURE_OPTIONS_USER = --enable-cxx-exceptions
SYSCONF ?= ../../
include $(SYSCONF)/package.mk

View File

@ -0,0 +1,4 @@
# Cannot compile
patch isn't working: musl-mips-fix.patch

View File

@ -0,0 +1,10 @@
--- a/src/unwind/libunwind.pc.in
+++ b/src/unwind/libunwind.pc.in
@@ -6,6 +6,6 @@
Name: libunwind
Description: libunwind base library
Version: @VERSION@
-Libs: -L${libdir} -lunwind
+Libs: -L${libdir} -lunwind -lucontext
Libs.private: @LIBLZMA@ @LIBZ@
Cflags: -I${includedir}

View File

@ -0,0 +1,11 @@
--- a/configure.ac
+++ b/configure.ac
@@ -201,7 +201,7 @@
AC_MSG_RESULT([$use_dwarf])
if test x$target_arch = xppc64; then
- libdir='${exec_prefix}/lib64'
+ libdir='${exec_prefix}/lib'
AC_MSG_NOTICE([PowerPC64 detected, lib will be installed ${libdir}]);
AC_SUBST([libdir])
fi

View File

@ -0,0 +1,16 @@
Man pages are already built in the release tarball, so we don't need latex2man.
--- a/configure.ac
+++ b/configure.ac
@@ -420,12 +420,6 @@
AC_SUBST(DLLIB)
AC_SUBST(BACKTRACELIB)
-AC_PATH_PROG([LATEX2MAN],[latex2man])
-if test "x$LATEX2MAN" = "x"; then
- AC_MSG_WARN([latex2man not found. Install latex2man. Disabling docs.])
- enable_documentation="no";
-fi
-
AM_CONDITIONAL([CONFIG_DOCS], [test x$enable_documentation = xyes])
if test "x$enable_documentation" = "xyes"; then
AC_CONFIG_FILES(doc/Makefile doc/common.tex)

View File

@ -0,0 +1,95 @@
--- a/src/coredump/_UCD_access_reg_linux.c
+++ b/src/coredump/_UCD_access_reg_linux.c
@@ -58,36 +58,36 @@
#if defined(UNW_TARGET_MIPS)
static const uint8_t remap_regs[] =
{
- [UNW_MIPS_R0] = EF_REG0,
- [UNW_MIPS_R1] = EF_REG1,
- [UNW_MIPS_R2] = EF_REG2,
- [UNW_MIPS_R3] = EF_REG3,
- [UNW_MIPS_R4] = EF_REG4,
- [UNW_MIPS_R5] = EF_REG5,
- [UNW_MIPS_R6] = EF_REG6,
- [UNW_MIPS_R7] = EF_REG7,
- [UNW_MIPS_R8] = EF_REG8,
- [UNW_MIPS_R9] = EF_REG9,
- [UNW_MIPS_R10] = EF_REG10,
- [UNW_MIPS_R11] = EF_REG11,
- [UNW_MIPS_R12] = EF_REG12,
- [UNW_MIPS_R13] = EF_REG13,
- [UNW_MIPS_R14] = EF_REG14,
- [UNW_MIPS_R15] = EF_REG15,
- [UNW_MIPS_R16] = EF_REG16,
- [UNW_MIPS_R17] = EF_REG17,
- [UNW_MIPS_R18] = EF_REG18,
- [UNW_MIPS_R19] = EF_REG19,
- [UNW_MIPS_R20] = EF_REG20,
- [UNW_MIPS_R21] = EF_REG21,
- [UNW_MIPS_R22] = EF_REG22,
- [UNW_MIPS_R23] = EF_REG23,
- [UNW_MIPS_R24] = EF_REG24,
- [UNW_MIPS_R25] = EF_REG25,
- [UNW_MIPS_R28] = EF_REG28,
- [UNW_MIPS_R29] = EF_REG29,
- [UNW_MIPS_R30] = EF_REG30,
- [UNW_MIPS_R31] = EF_REG31,
+ [UNW_MIPS_R0] = EF_R0,
+ [UNW_MIPS_R1] = EF_R1,
+ [UNW_MIPS_R2] = EF_R2,
+ [UNW_MIPS_R3] = EF_R3,
+ [UNW_MIPS_R4] = EF_R4,
+ [UNW_MIPS_R5] = EF_R5,
+ [UNW_MIPS_R6] = EF_R6,
+ [UNW_MIPS_R7] = EF_R7,
+ [UNW_MIPS_R8] = EF_R8,
+ [UNW_MIPS_R9] = EF_R9,
+ [UNW_MIPS_R10] = EF_R10,
+ [UNW_MIPS_R11] = EF_R11,
+ [UNW_MIPS_R12] = EF_R12,
+ [UNW_MIPS_R13] = EF_R13,
+ [UNW_MIPS_R14] = EF_R14,
+ [UNW_MIPS_R15] = EF_R15,
+ [UNW_MIPS_R16] = EF_R16,
+ [UNW_MIPS_R17] = EF_R17,
+ [UNW_MIPS_R18] = EF_R18,
+ [UNW_MIPS_R19] = EF_R19,
+ [UNW_MIPS_R20] = EF_R20,
+ [UNW_MIPS_R21] = EF_R21,
+ [UNW_MIPS_R22] = EF_R22,
+ [UNW_MIPS_R23] = EF_R23,
+ [UNW_MIPS_R24] = EF_R24,
+ [UNW_MIPS_R25] = EF_R25,
+ [UNW_MIPS_R28] = EF_R28,
+ [UNW_MIPS_R29] = EF_R29,
+ [UNW_MIPS_R30] = EF_R30,
+ [UNW_MIPS_R31] = EF_R31,
[UNW_MIPS_PC] = EF_CP0_EPC,
};
#elif defined(UNW_TARGET_X86)
--- a/src/coredump/_UCD_lib.h
+++ b/src/coredump/_UCD_lib.h
@@ -50,6 +50,7 @@
#include <stdbool.h>
#include <limits.h>
#include <sys/param.h>
+#include <sys/reg.h>
#include <pwd.h>
#include <grp.h>
#include <syslog.h>
--- a/src/mips/getcontext.S
+++ b/src/mips/getcontext.S
@@ -24,12 +24,11 @@
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#include "offsets.h"
-#include <endian.h>
.text
#if _MIPS_SIM == _ABIO32
-# if __BYTE_ORDER == __BIG_ENDIAN
+# if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
# define OFFSET 4
# else
# define OFFSET 0

View File

@ -0,0 +1,11 @@
--- a/src/ptrace/_UPT_reg_offset.c
+++ b/src/ptrace/_UPT_reg_offset.c
@@ -32,6 +32,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
# include <asm/ptrace_offsets.h>
#endif
+#include <asm/ptrace.h>
+
const int _UPT_reg_offset[UNW_REG_LAST + 1] =
{
#ifdef HAVE_ASM_PTRACE_OFFSETS_H

42
recipes/linux/Makefile Normal file
View File

@ -0,0 +1,42 @@
name = linux
version = 5.11
URL = https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-$(version).tar.xz
build-dependencies = flex bison perl
dependencies = binutils
# WARNING: this has to be the same environment variables used
# during the creation of the config file
MAKE_OPTIONS_USER = CC=clang \
LD=ld.lld \
AR=llvm-ar \
NM=llvm-nm \
STRIP=llvm-strip \
OBJCOPY=llvm-objcopy \
OBJDUMP=llvm-objdump \
READELF=llvm-readelf \
HOSTCC=clang \
HOSTCXX=clang++ \
HOSTAR=llvm-ar \
HOSTLD=ld.lld
SYSCONF ?= ../../
include $(SYSCONF)/package.mk
pre_configure:
$(Q)cd $(bdir) && make mrproper
$(Q)cp config $(bdir)/.config
fake_root_install:
@mkdir -p '$(pkg_fake_root_dir)/$(PREFIX)' '$(pkg_fake_root_dir)/boot'
@# $(pkg_fake_root_dir)/boot: main package (kernel, vm and config)
$(Q)cp $(bdir)/arch/x86/boot/bzImage $(pkg_fake_root_dir)/boot/linux-$(version)
$(Q)cp $(bdir)/vmlinux $(pkg_fake_root_dir)/boot/vmlinux-$(version)
$(Q)cp config $(pkg_fake_root_dir)/boot/linux-$(version).cfg
@# $(pkg_fake_root_dir)/$(PREFIX): -dev split (headers).
$(Q)cd $(bdir) && make headers_install ARCH=x86_64 INSTALL_HDR_PATH='$(pkg_fake_root_dir)/$(PREFIX)'

4653
recipes/linux/config Normal file

File diff suppressed because it is too large Load Diff

7
recipes/lzo/Makefile Normal file
View File

@ -0,0 +1,7 @@
name = lzo
version = 2.10
URL = http://www.oberhumer.com/opensource/lzo/download/lzo-$(version).tar.gz
SYSCONF ?= ../../
include $(SYSCONF)/package.mk

9
recipes/m4/Makefile Normal file
View File

@ -0,0 +1,9 @@
name = m4
version = 1.4.18
release = 0
URL = https://ftp.gnu.org/gnu/m4/m4-$(version).tar.gz
dependencies = perl
SYSCONF ?= ../../
include $(SYSCONF)/package.mk

7
recipes/make/Makefile Normal file
View File

@ -0,0 +1,7 @@
name = make
version = 4.3
release = 0
URL = https://ftp.gnu.org/gnu/make/make-$(version).tar.gz
SYSCONF ?= ../../
include $(SYSCONF)/package.mk

9
recipes/mpc/Makefile Normal file
View File

@ -0,0 +1,9 @@
name = mpc
version = 1.2.1
release = 0
URL = https://ftp.gnu.org/gnu/mpc/mpc-$(version).tar.gz
dependencies = mpfr-dev
SYSCONF ?= ../../
include $(SYSCONF)/package.mk

17
recipes/xz/Makefile Normal file
View File

@ -0,0 +1,17 @@
name = xz
version = 5.2.5
URL = https://tukaani.org/xz/xz-$(version).tar.xz
patches =
conflicts =
SYSCONF ?= ../../
include $(SYSCONF)/package.mk
# for test purposes
pre_configure:
@echo "PRECONFIGURATON OVERRIDE"
.PHONY: # all clean distclean dist install uninstall help