Skip to content

Commit

Permalink
Fix #12335 - ignore system-installed r2 includes ##build
Browse files Browse the repository at this point in the history
  • Loading branch information
trufae committed May 27, 2021
1 parent 46ec83c commit 23ad9b5
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 19 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -10,6 +10,21 @@ on:


jobs:
build-oldlibs:
name: linux-acr-oldlibsbug
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setting up bad libnames
run: |
mkdir -p /tmp/fakelibs /tmp/fakeincs
for a in anal asm cons crypto flag hash lang parse reg search syscall util ; do touch /tmp/fakelibs/libr_$a.a ; touch /tmp/fakelibs/libr_$a.so ; done
touch /tmp/fakeincs/r_util.h
chmod 000 /tmp/fakelibs/*
export CFLAGS=-I/tmp/fakeincs/
export LDFLAGS=-L/tmp/fakelibs/
sys/install.sh
build-acr-gperf:
name: linux-acr-gperf
runs-on: ubuntu-20.04
Expand Down
2 changes: 1 addition & 1 deletion binr/rules.mk
Expand Up @@ -6,7 +6,7 @@ include ../../shlr/sdb.mk
ifeq (,$(findstring tcc,${CC}))
CFLAGS+=-pie
endif
CFLAGS+=-I$(LTOP)/include
CFLAGS:=-I$(LTOP)/include -I$(LTOP)/include/sdb $(CFLAGS)

ifeq (${ANDROID},1)
LDFLAGS+=-lm
Expand Down
4 changes: 1 addition & 3 deletions libr/anal/Makefile
Expand Up @@ -2,12 +2,10 @@ include ../config.mk

EXTRA_TARGETS+=do
EXTRA_CLEAN=doclean
CFLAGS+=-I..

NAME=r_anal
R2DEPS=r_util r_reg r_syscall r_search r_cons r_flag r_hash r_crypto r_parse
CFLAGS+=-DR2_PLUGIN_INCORE -Iarch -I$(TOP)/shlr
CFLAGS+=-I$(LTOP)/asm/arch/include
CFLAGS:=-I.. -I$(LTOP)/asm/arch/include -DR2_PLUGIN_INCORE -Iarch -I$(TOP)/shlr $(CFLAGS)

LDFLAGS+=${BN_LIBS}

Expand Down
4 changes: 2 additions & 2 deletions libr/fs/Makefile
@@ -1,11 +1,11 @@
NAME=r_fs
R2DEPS=r_util r_io r_socket r_hash r_cons r_crypto
CFLAGS+=-DR2_PLUGIN_INCORE -Iarch/include -Iarch
CFLAGS:=-DR2_PLUGIN_INCORE -Iarch/include -Iarch $(CFLAGS)

SHLR=../../shlr/

include ../config.mk
CFLAGS+=-I$(SHLR)/grub/include
CFLAGS:=-I$(SHLR)/grub/include $(CFLAGS)
ifeq ($(WITH_GPL),1)
LDFLAGS+=$(SHLR)/grub/libgrubfs.a
endif
Expand Down
3 changes: 1 addition & 2 deletions libr/rules.mk
Expand Up @@ -16,8 +16,7 @@ LIBR:=$(abspath $(dir $(lastword $(MAKEFILE_LIST))))
# /libr

ALL?=
CFLAGS+=-I$(LIBR)
CFLAGS+=-I$(LIBR)/include
CFLAGS:=-I$(LIBR) -I$(LIBR)/include $(CFLAGS)

-include $(SHLR)/sdb.mk

Expand Down
15 changes: 15 additions & 0 deletions p
@@ -0,0 +1,15 @@
diff --git a/libr/rules.mk b/libr/rules.mk
index a9e47e6c39..4b16ff5ab2 100644
--- a/libr/rules.mk
+++ b/libr/rules.mk
@@ -87,8 +87,8 @@ $(LIBSO): $(EXTRA_TARGETS) ${WFD} ${OBJS} ${SHARED_OBJ}
if [ $$do = 1 ]; then \
[ -n "${SILENT}" ] && \
echo "LD $(LIBSO)" || \
- echo "\"${CC_LIB} ${LIBNAME} ${OBJS} ${SHARED_OBJ} ${LINK} ${LDFLAGS}\"" ; \
- ${CC_LIB} ${LIBNAME} ${CFLAGS} ${OBJS} ${SHARED_OBJ} ${LINK} ${LDFLAGS} || exit 1; \
+ echo "\"${CC_LIB} $(LINK) ${LIBNAME} ${OBJS} ${SHARED_OBJ} ${LDFLAGS}\"" ; \
+ ${CC_LIB} $(LINK) ${LIBNAME} ${CFLAGS} ${OBJS} ${SHARED_OBJ} ${LDFLAGS} || exit 1; \
[ -f "$(LIBR)/stripsyms.sh" ] && sh "$(LIBR)/stripsyms.sh" "${LIBSO}" ${NAME} ; \
break ; \
fi ; done
2 changes: 1 addition & 1 deletion shlr/ar/Makefile
Expand Up @@ -26,7 +26,7 @@ endif
endif
endif

CFLAGS+=-I../../libr/include
CFLAGS:=-I../../libr/include -I../../libr/include/sdb $(CFLAGS)
LIBAR=libr_ar.${EXT_AR}
LDFLAGS+=-L../../libr/util
LIBS=-lr_util
Expand Down
3 changes: 1 addition & 2 deletions shlr/bochs/Makefile
Expand Up @@ -6,8 +6,7 @@ AR?=ar
RANLIB?=ranlib
LIBNAME=libbochs
LIBFILE=$(LIBNAME).$(EXT_SO)
CFLAGS+=-I$(LIBR)/include $(PIC_CFLAGS)
CFLAGS+=-Iinclude -I${LIBR}/include
CFLAGS:=-I$(LIBR)/include -I$(LIBR)/include/sdb -Iinclude $(PIC_CFLAGS) $(CFLAGS)
MAJOR=0
MINOR=1
LD=$(CC)
Expand Down
2 changes: 1 addition & 1 deletion shlr/gdb/Makefile
Expand Up @@ -9,7 +9,7 @@ AR?=$(CC_AR)
RANLIB?=ranlib
LIBNAME=libgdbr
LIBFILE=$(LIBNAME).$(EXT_SO)
CFLAGS+=-I$(LIBR)/include $(PIC_CFLAGS)
CFLAGS:=-I$(LIBR)/include -I$(LIBR)/include/sdb $(PIC_CFLAGS) $(CFLAGS)
CFLAGS+=-Iinclude -I${LIBR}/include
MAJOR=0
MINOR=1
Expand Down
4 changes: 2 additions & 2 deletions shlr/grub/Makefile
Expand Up @@ -60,9 +60,9 @@ KERNFILES+=partmap/bsdlabel.c
KERNFILES+=partmap/sunpc.c

KERNOBJS=$(subst .c,.o,${KERNFILES})
CFLAGS:=-I../../libr/include -I../../libr/include/sdb -DGRUB_TARGET_NO_MODULES $(CFLAGS)
CFLAGS+=-Iinclude
CFLAGS+=-I../../libr/include -DGRUB_TARGET_NO_MODULES
CFLAGS+=-g
# CFLAGS+=-g

ifneq (,$(findstring cygwin,${OSTYPE}))
CFLAGS+=-D__CYGWIN__=1
Expand Down
4 changes: 2 additions & 2 deletions shlr/java/Makefile
Expand Up @@ -26,9 +26,9 @@ CFLAGS+=${PIC_CFLAGS}
ifneq (,$(findstring mingw32,${OSTYPE}))
CFLAGS+=-DMINGW32=1
endif
CFLAGS+=-g
# CFLAGS+=-g

CFLAGS+=-I../../libr/include
CFLAGS:=-I../../libr/include -I../../libr/include/sdb $(CFLAGS)
LDFLAGS+=-L../../libr/util
OBJS=code.o class.o ops.o dsojson.o

Expand Down
3 changes: 1 addition & 2 deletions shlr/qnx/Makefile
Expand Up @@ -7,8 +7,7 @@ AR?=ar
RANLIB?=ranlib
LIBNAME=libqnxr
LIBFILE=$(LIBNAME).$(EXT_SO)
CFLAGS+=-I$(LIBR)/include $(PIC_CFLAGS)
CFLAGS+=-Iinclude -I${LIBR}/include
CFLAGS:=-Iinclude -I$(LIBR)/include -I$(LIBR)/include/sdb $(PIC_CFLAGS) $(CFLAGS)
MAJOR=0
MINOR=1
LD=$(CC)
Expand Down
2 changes: 1 addition & 1 deletion shlr/winkd/Makefile
Expand Up @@ -3,9 +3,9 @@ include ../../config-user.mk
include ../../mk/platform.mk
include ../../mk/${COMPILER}.mk

CFLAGS:=-I../../libr/include -I../../libr/include/sdb $(CFLAGS)
CFLAGS+=${PIC_CFLAGS}

CFLAGS+=-I../../libr/include
LIBAR=libr_winkd.${EXT_AR}
LDFLAGS+=-L../../libr/crypto -lr_crypto
LDFLAGS+=-L../../libr/hash -lr_hash
Expand Down

0 comments on commit 23ad9b5

Please sign in to comment.