mirror of https://github.com/ventoy/Ventoy
Rebuild some binaries with musl-libc to avoid virus false positive (issue #660)
parent
ff0ad76d8d
commit
4707b76bb2
@ -1,20 +1,36 @@
|
|||||||
======== Build busybox 1.32 for aarch64 ========
|
======== How to build ash/hexdump/xzcat for aarch64 ========
|
||||||
|
#How to get ash.config/hexdump.cofig/xzcat.config
|
||||||
ARCH=arm64 CROSS_COMPILE=aarch64-linux- make defconfig
|
#ARCH=arm64 CROSS_COMPILE=aarch64-linux- make allnoconfig
|
||||||
ARCH=arm64 CROSS_COMPILE=aarch64-linux- make menuconfig
|
#ARCH=arm64 CROSS_COMPILE=aarch64-linux- make menuconfig
|
||||||
----> enable static build
|
#----> enable static build
|
||||||
----> enable ar
|
#----> enable xzcat
|
||||||
----> enable inotifyd
|
#get aarch64_xzcat.config
|
||||||
|
|
||||||
|
tar xf busybox-1.32.0.tar.bz2
|
||||||
|
cd busybox-1.32.0
|
||||||
|
copy aarch64_xzcat.config as .config
|
||||||
ARCH=arm64 CROSS_COMPILE=aarch64-linux- make
|
ARCH=arm64 CROSS_COMPILE=aarch64-linux- make
|
||||||
|
rename ./busybox to xzcat
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
======== How to build ash/hexdump/xzcat for x86_64 ==========
|
||||||
|
#How to get ash.config/hexdump.cofig/xzcat.config
|
||||||
|
#make allnoconfig
|
||||||
|
#make menuconfig
|
||||||
|
#----> enable static build
|
||||||
|
#----> enable xzcat
|
||||||
|
#get x86_64_xzcat.config
|
||||||
|
|
||||||
ARCH=arm64 CROSS_COMPILE=aarch64-linux- make allnoconfig
|
|
||||||
|
|
||||||
|
tar xf busybox-1.32.0.tar.bz2
|
||||||
|
cd busybox-1.32.0
|
||||||
|
copy x86_64_xzcat.config as .config
|
||||||
|
modify Makefile
|
||||||
|
CC = gcc -specs "/usr/local/musl/lib/musl-gcc.specs"
|
||||||
|
MODFLAGS = -DMODULE -specs "/usr/local/musl/lib/musl-gcc.specs"
|
||||||
|
make
|
||||||
|
rename ./busybox to xzcat
|
||||||
|
|
||||||
======== use mini-native-x86_64 uclibc to build ash/hexdump/busybox for x86_64 ==========
|
|
||||||
|
|
||||||
|
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,48 @@
|
|||||||
|
#
|
||||||
|
# Makefile
|
||||||
|
#
|
||||||
|
# Author: Lasse Collin <lasse.collin@tukaani.org>
|
||||||
|
#
|
||||||
|
# This file has been put into the public domain.
|
||||||
|
# You can do whatever you want with this file.
|
||||||
|
#
|
||||||
|
|
||||||
|
CC = gcc -specs "/usr/local/musl/lib/musl-gcc.specs" -Os -static -std=gnu89
|
||||||
|
BCJ_CPPFLAGS = -DXZ_DEC_X86 -DXZ_DEC_POWERPC -DXZ_DEC_IA64 \
|
||||||
|
-DXZ_DEC_ARM -DXZ_DEC_ARMTHUMB -DXZ_DEC_SPARC
|
||||||
|
CPPFLAGS = -DXZ_USE_CRC64 -DXZ_DEC_ANY_CHECK
|
||||||
|
CFLAGS = -ggdb3 -O2 -pedantic -Wall -Wextra
|
||||||
|
RM = rm -f
|
||||||
|
VPATH = ../linux/include/linux ../linux/lib/xz
|
||||||
|
COMMON_SRCS = xz_crc32.c xz_crc64.c xz_dec_stream.c xz_dec_lzma2.c xz_dec_bcj.c
|
||||||
|
COMMON_OBJS = $(COMMON_SRCS:.c=.o)
|
||||||
|
XZMINIDEC_OBJS = xzminidec.o
|
||||||
|
BYTETEST_OBJS = bytetest.o
|
||||||
|
BUFTEST_OBJS = buftest.o
|
||||||
|
BOOTTEST_OBJS = boottest.o
|
||||||
|
XZ_HEADERS = xz.h xz_private.h xz_stream.h xz_lzma2.h xz_config.h
|
||||||
|
PROGRAMS = xzminidec bytetest buftest boottest
|
||||||
|
|
||||||
|
ALL_CPPFLAGS = -I../linux/include/linux -I. $(BCJ_CPPFLAGS) $(CPPFLAGS)
|
||||||
|
|
||||||
|
all: $(PROGRAMS)
|
||||||
|
|
||||||
|
%.o: %.c $(XZ_HEADERS)
|
||||||
|
$(CC) $(ALL_CPPFLAGS) $(CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
|
xzminidec: $(COMMON_OBJS) $(XZMINIDEC_OBJS)
|
||||||
|
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(COMMON_OBJS) $(XZMINIDEC_OBJS)
|
||||||
|
|
||||||
|
bytetest: $(COMMON_OBJS) $(BYTETEST_OBJS)
|
||||||
|
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(COMMON_OBJS) $(BYTETEST_OBJS)
|
||||||
|
|
||||||
|
buftest: $(COMMON_OBJS) $(BUFTEST_OBJS)
|
||||||
|
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(COMMON_OBJS) $(BUFTEST_OBJS)
|
||||||
|
|
||||||
|
boottest: $(BOOTTEST_OBJS) $(COMMON_SRCS)
|
||||||
|
$(CC) $(ALL_CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(BOOTTEST_OBJS)
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
|
clean:
|
||||||
|
-$(RM) $(COMMON_OBJS) $(XZMINIDEC_OBJS) $(BUFTEST_OBJS) \
|
||||||
|
$(BOOTTEST_OBJS) $(PROGRAMS)
|
@ -0,0 +1,48 @@
|
|||||||
|
#
|
||||||
|
# Makefile
|
||||||
|
#
|
||||||
|
# Author: Lasse Collin <lasse.collin@tukaani.org>
|
||||||
|
#
|
||||||
|
# This file has been put into the public domain.
|
||||||
|
# You can do whatever you want with this file.
|
||||||
|
#
|
||||||
|
|
||||||
|
CC = /opt/aarch64--uclibc--stable-2020.08-1/bin/aarch64-linux-gcc -Os -static -std=gnu89
|
||||||
|
BCJ_CPPFLAGS = -DXZ_DEC_X86 -DXZ_DEC_POWERPC -DXZ_DEC_IA64 \
|
||||||
|
-DXZ_DEC_ARM -DXZ_DEC_ARMTHUMB -DXZ_DEC_SPARC
|
||||||
|
CPPFLAGS = -DXZ_USE_CRC64 -DXZ_DEC_ANY_CHECK
|
||||||
|
CFLAGS = -ggdb3 -O2 -pedantic -Wall -Wextra
|
||||||
|
RM = rm -f
|
||||||
|
VPATH = ../linux/include/linux ../linux/lib/xz
|
||||||
|
COMMON_SRCS = xz_crc32.c xz_crc64.c xz_dec_stream.c xz_dec_lzma2.c xz_dec_bcj.c
|
||||||
|
COMMON_OBJS = $(COMMON_SRCS:.c=.o)
|
||||||
|
XZMINIDEC_OBJS = xzminidec.o
|
||||||
|
BYTETEST_OBJS = bytetest.o
|
||||||
|
BUFTEST_OBJS = buftest.o
|
||||||
|
BOOTTEST_OBJS = boottest.o
|
||||||
|
XZ_HEADERS = xz.h xz_private.h xz_stream.h xz_lzma2.h xz_config.h
|
||||||
|
PROGRAMS = xzminidec bytetest buftest boottest
|
||||||
|
|
||||||
|
ALL_CPPFLAGS = -I../linux/include/linux -I. $(BCJ_CPPFLAGS) $(CPPFLAGS)
|
||||||
|
|
||||||
|
all: $(PROGRAMS)
|
||||||
|
|
||||||
|
%.o: %.c $(XZ_HEADERS)
|
||||||
|
$(CC) $(ALL_CPPFLAGS) $(CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
|
xzminidec: $(COMMON_OBJS) $(XZMINIDEC_OBJS)
|
||||||
|
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(COMMON_OBJS) $(XZMINIDEC_OBJS)
|
||||||
|
|
||||||
|
bytetest: $(COMMON_OBJS) $(BYTETEST_OBJS)
|
||||||
|
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(COMMON_OBJS) $(BYTETEST_OBJS)
|
||||||
|
|
||||||
|
buftest: $(COMMON_OBJS) $(BUFTEST_OBJS)
|
||||||
|
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(COMMON_OBJS) $(BUFTEST_OBJS)
|
||||||
|
|
||||||
|
boottest: $(BOOTTEST_OBJS) $(COMMON_SRCS)
|
||||||
|
$(CC) $(ALL_CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(BOOTTEST_OBJS)
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
|
clean:
|
||||||
|
-$(RM) $(COMMON_OBJS) $(XZMINIDEC_OBJS) $(BUFTEST_OBJS) \
|
||||||
|
$(BOOTTEST_OBJS) $(PROGRAMS)
|
Binary file not shown.
Loading…
Reference in New Issue