Add CI job for CentOS 6 build (#16712)

* Fix re-definition of RAnalBlockCb and RAnalAddrCb

* Small compilation fixes for gcc-4

* Check PTRACE_GETREGSET before using it

* Add GH workflow to run on centos:6 for prerelease branches

* Fix configure.acr
This commit is contained in:
Riccardo Schirone 2020-04-29 13:02:02 +02:00 committed by GitHub
parent cb7d6b4390
commit a29f0ccce5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 72 additions and 11 deletions

34
.github/workflows/centos6.yml vendored Normal file
View File

@ -0,0 +1,34 @@
name: centos6 test
on:
push:
branches:
- 'pre-release*'
- 'prerelease*'
- 'release-*'
- 'centos*'
jobs:
build:
name: centos-6-build
runs-on: ubuntu-latest
container: centos:6
steps:
- name: Install tools
run: yum install -y patch unzip git gcc make
- name: Checkout r2
run: |
git clone https://github.com/${{ github.repository }}
cd radare2
git fetch origin ${{ github.ref }}
git checkout -b local_branch FETCH_HEAD
- name: Configure with ACR and build
run: ./configure --prefix=/usr && make CS_RELEASE=1
working-directory: radare2
- name: Install with make
run: make install
working-directory: radare2
- name: Run tests
run: cd test/unit && make
working-directory: radare2

View File

@ -4,6 +4,9 @@ on:
push:
branches:
- master
- 'pre-release*'
- 'prerelease*'
- 'release*'
jobs:
build:

View File

@ -4,4 +4,5 @@ OBJ=load.o run.o
include ../rules.mk
LDFLAGS+=$(CLOCK_LDFLAGS)
LDFLAGS+=$(LINK)

View File

@ -87,6 +87,8 @@ USE_PTRACE_WRAP=@USE_PTRACE_WRAP@
GIT_TIP:=$(shell (git rev-parse HEAD 2>/dev/null || echo HEAD ))
GIT_TAP:=$(shell (git describe --tags 2>/dev/null || echo ${VERSION} ))
CLOCK_LDFLAGS+=@CLOCK_LDFLAGS@
# cache compiler flags at configure time #
CFLAGS+=@CFLAGS@
LDFLAGS+=@LDFLAGS@

20
configure vendored
View File

@ -320,7 +320,7 @@ parse_options "$1"
shift
done
ENVWORDS="MANDIR INFODIR LIBDIR INCLUDEDIR LOCALSTATEDIR SYSCONFDIR DATADIR DOCDIR LIBEXECDIR SBINDIR BINDIR EPREFIX PREFIX SPREFIX TARGET HOST BUILD INSTALL INSTALL_LIB INSTALL_MAN INSTALL_PROGRAM INSTALL_PROGRAM_STRIP INSTALL_DIR INSTALL_SCRIPT INSTALL_DATA HOST_OS HOST_CPU BUILD_OS BUILD_CPU TARGET_OS TARGET_CPU VERSION VERSION_MAJOR VERSION_MINOR VERSION_PATCH VERSION_NUMBER PKGNAME VPATH CONTACT CONTACT_NAME CONTACT_MAIL CC CFLAGS CPPFLAGS LDFLAGS HAVE_LANG_C DEBUGGER HAVE_LIB_DL DL_LIBS HAVE_PATCH PATCH HAVE_GIT GIT HAVE_LIB_MAGIC USE_MAGIC USE_LIB_MAGIC LIBMAGIC CSNEXT LOADLIBS HAVE_FORK WANT_PTRACE_WRAP WITH_LIBR WITH_CAPSTONE CAPSTONE_CFLAGS CAPSTONE_LDFLAGS HAVE_PKGCFG_CAPSTONE USE_CAPSTONE HAVE_LIB_Z HAVE_LIB_ZIP USE_ZIP USE_LIB_ZIP LIBZIP HAVE_LIB_XXHASH USE_XXHASH USE_LIB_XXHASH LIBXXHASH WITH_GPL HAVE_DECL_ADDR_NO_RANDOMIZE HAVE_ARC4RANDOM_UNIFORM HAVE_EXPLICIT_BZERO HAVE_EXPLICIT_MEMSET HAVE_CLOCK_NANOSLEEP HAVE_SIGACTION HAVE_LIB_GMP HAVE_LIB_SSL SSL_CFLAGS SSL_LDFLAGS HAVE_PKGCFG_OPENSSL HAVE_OPENSSL WANT_OPENSSL HAVE_LIBUV_VERSION_1_0_0 LIBUV_CFLAGS LIBUV_LDFLAGS HAVE_PKGCFG_LIBUV HAVE_LIBUV WANT_LIBUV USE_RPATH USERCC USEROSTYPE LIBVERSION HAVE_JEMALLOC HAVE_PTRACE USE_PTRACE_WRAP R_CHECKS_LEVEL"
ENVWORDS="MANDIR INFODIR LIBDIR INCLUDEDIR LOCALSTATEDIR SYSCONFDIR DATADIR DOCDIR LIBEXECDIR SBINDIR BINDIR EPREFIX PREFIX SPREFIX TARGET HOST BUILD INSTALL INSTALL_LIB INSTALL_MAN INSTALL_PROGRAM INSTALL_PROGRAM_STRIP INSTALL_DIR INSTALL_SCRIPT INSTALL_DATA HOST_OS HOST_CPU BUILD_OS BUILD_CPU TARGET_OS TARGET_CPU VERSION VERSION_MAJOR VERSION_MINOR VERSION_PATCH VERSION_NUMBER PKGNAME VPATH CONTACT CONTACT_NAME CONTACT_MAIL CC CFLAGS CPPFLAGS LDFLAGS HAVE_LANG_C DEBUGGER HAVE_LIB_DL DL_LIBS HAVE_PATCH PATCH HAVE_GIT GIT HAVE_LIB_MAGIC USE_MAGIC USE_LIB_MAGIC LIBMAGIC CSNEXT LOADLIBS HAVE_FORK WANT_PTRACE_WRAP WITH_LIBR WITH_CAPSTONE CAPSTONE_CFLAGS CAPSTONE_LDFLAGS HAVE_PKGCFG_CAPSTONE USE_CAPSTONE HAVE_LIB_Z HAVE_LIB_ZIP USE_ZIP USE_LIB_ZIP LIBZIP HAVE_LIB_XXHASH USE_XXHASH USE_LIB_XXHASH LIBXXHASH WITH_GPL HAVE_DECL_ADDR_NO_RANDOMIZE HAVE_DECL___GLIBC__ HAVE_ARC4RANDOM_UNIFORM HAVE_EXPLICIT_BZERO HAVE_EXPLICIT_MEMSET HAVE_CLOCK_NANOSLEEP HAVE_SIGACTION HAVE_CLOCK_GETTIME CLOCK_LDFLAGS HAVE_LIB_GMP HAVE_LIB_SSL SSL_CFLAGS SSL_LDFLAGS HAVE_PKGCFG_OPENSSL HAVE_OPENSSL WANT_OPENSSL HAVE_LIBUV_VERSION_1_0_0 LIBUV_CFLAGS LIBUV_LDFLAGS HAVE_PKGCFG_LIBUV HAVE_LIBUV WANT_LIBUV USE_RPATH USERCC USEROSTYPE LIBVERSION HAVE_JEMALLOC HAVE_PTRACE USE_PTRACE_WRAP R_CHECKS_LEVEL"
create_environ
@ -490,6 +490,14 @@ if [ $? = 0 ]; then
echo yes ; HAVE_DECL_ADDR_NO_RANDOMIZE=1
else
HAVE_DECL_ADDR_NO_RANDOMIZE=0 ; echo no ; fi
printf "checking declaration of __GLIBC__ in features.h... "
echo "#include <features.h>" > test.c
echo "int main(int ac, char **av){ void *a = __GLIBC__; return 0; }" >> test.c
${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} test.c >/dev/null 2>&1
if [ $? = 0 ]; then
echo yes ; HAVE_DECL___GLIBC__=1
else
HAVE_DECL___GLIBC__=0 ; echo no ; fi
printf "checking function arc4random_uniform() in c... "
echo "int main(int ac, char **av){ arc4random_uniform(0); return 0; }" > test.c
${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -lc test.c >/dev/null 2>&1
@ -525,6 +533,16 @@ if [ $? = 0 ]; then
echo yes ; HAVE_SIGACTION=1
else
HAVE_SIGACTION=0 ; echo no ; fi
printf "checking function clock_gettime() in c... "
echo "int main(int ac, char **av){ clock_gettime(0); return 0; }" > test.c
${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -lc test.c >/dev/null 2>&1
if [ $? = 0 ]; then
echo yes ; HAVE_CLOCK_GETTIME=1
else
HAVE_CLOCK_GETTIME=0 ; echo no ; fi
if [ "$HAVE_CLOCK_GETTIME" = "0" ]; then
if [ "$HAVE_DECL___GLIBC__" = "1" ]; then
CLOCK_LDFLAGS="${CLOCK_LDFLAGS} '-lrt'"; fi; fi
HAVE_LIB_GMP="0"
check_library HAVE_LIB_SSL ssl 0
[ -z "${PKGCONFIG}" ] && PKGCONFIG=pkg-config

View File

@ -70,11 +70,19 @@ IFAND HAVE_LIB_XXHASH USE_XXHASH {
ARG_WITHOUT WITH_GPL gpl do not build GPL code (grub, cxx, ... ) ;
CHKDECL sys/personality.h ADDR_NO_RANDOMIZE
CHKDECL features.h __GLIBC__
CHKFNC c arc4random_uniform
CHKFNC c explicit_bzero
CHKFNC c explicit_memset
CHKFNC c clock_nanosleep
CHKFNC c sigaction
CHKFNC c clock_gettime
IFNOT HAVE_CLOCK_GETTIME {
IF HAVE_DECL___GLIBC__ {
CLOCK_LDFLAGS += '-lrt' ;
}
}
(( TODO must deprecate
CHKLIB gmp

View File

@ -364,9 +364,6 @@ R_API void r_anal_block_unref(RAnalBlock *bb) {
}
}
typedef bool (*RAnalBlockCb)(RAnalBlock *block, void *user);
typedef bool (*RAnalAddrCb)(ut64 addr, void *user);
R_API bool r_anal_block_successor_addrs_foreach(RAnalBlock *block, RAnalAddrCb cb, void *user) {
#define CB_ADDR(addr) do { \
if (addr == UT64_MAX) { \
@ -802,4 +799,4 @@ beach:
ht_up_free (ctx.blocks);
ht_up_free (relevant_fcns);
r_list_free (fixup_candidates);
}
}

View File

@ -16,6 +16,7 @@ CFLAGS+=-I../../shlr/heap/include
CFLAGS+=-I../../shlr/tree-sitter/lib/include -I../../shlr/radare2-shell-parser/src/tree_parser
CFLAGS+=-DR2_PLUGIN_INCORE -I../../shlr
LDFLAGS+=${DL_LIBS}
LDFLAGS+=${CLOCK_LDFLAGS}
ifeq ($(shell uname),OpenBSD)
LDFLAGS+=-lpthread

View File

@ -1371,7 +1371,7 @@ static bool arm32_hwbp_del (RDebug *dbg, RBreakpoint *bp, RBreakpointItem *b) {
#endif // PTRACE_GETHWBPREGS
#endif // __arm
#if __arm64__ || __aarch64__
#if (__arm64__ || __aarch64__) && defined(PTRACE_GETREGSET)
// type = 2 = write
//static volatile uint8_t var[96] __attribute__((__aligned__(32)));

View File

@ -46,9 +46,6 @@ char *linux_reg_profile (RDebug *dbg) {
#endif
} else {
# include "reg/linux-x64.h"
#if HAVE_YMM
# include <bits/sigcontext.h>
#endif
}
#elif __powerpc__
if (dbg->bits & R_SYS_BITS_32) {
@ -1075,7 +1072,7 @@ int linux_reg_read(RDebug *dbg, int type, ut8 *buf, int size) {
R_DEBUG_REG_T regs;
memset (&regs, 0, sizeof (regs));
memset (buf, 0, size);
#if __arm64__ || __aarch64__ || __s390x__
#if (__arm64__ || __aarch64__ || __s390x__) && defined(PTRACE_GETREGSET)
struct iovec io = {
.iov_base = &regs,
.iov_len = sizeof (regs)
@ -1106,7 +1103,7 @@ int linux_reg_read(RDebug *dbg, int type, ut8 *buf, int size) {
break;
case R_REG_TYPE_YMM:
{
#if HAVE_YMM && __x86_64__
#if HAVE_YMM && __x86_64__ && defined(PTRACE_GETREGSET)
ut32 ymm_space[128]; // full ymm registers
struct _xstate xstate;
struct iovec iov;