[Tarantool-patches] [PATCH luajit v4 7/8] Fix build with busybox grep.

sergos sergos at tarantool.org
Tue Dec 6 00:51:27 MSK 2022


Hi!

Thanks for the patch!

LGTM

Sergos


> On 28 Oct 2022, at 12:26, Maksim Kokryashkin <max.kokryashkin at gmail.com> wrote:
> 
> From: Mike Pall <mike>
> 
> Reported by ymph.
> 
> (cherry picked from commit 66563bdab0c7acf3cd61dc6cfcca36275951d084)
> 
> Busybox implementation of grep doesn't have the `-U` option, but it
> has the option to treat the binary as a text file, so that case is
> provided as an alternative.
> 
> Maxim Kokryashkin:
> * added the description for the problem and updated the CMake
> 
> Needed for tarantool/tarantool#6096
> Part of tarantool/tarantool#7230
> ---
> cmake/SetTargetFlags.cmake | 2 +-
> src/Makefile.original      | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/cmake/SetTargetFlags.cmake b/cmake/SetTargetFlags.cmake
> index 943a3152..8abb6288 100644
> --- a/cmake/SetTargetFlags.cmake
> +++ b/cmake/SetTargetFlags.cmake
> @@ -23,7 +23,7 @@ else()
>   string(FIND ${TARGET_C_FLAGS} "LJ_NO_UNWIND 1" UNWIND_POS)
>   if(UNWIND_POS EQUAL -1)
>     execute_process(
> -      COMMAND bash -c "exec 2>/dev/null; echo 'extern void b(void);int a(void){b();return 0;}' | ${CMAKE_C_COMPILER} -c -x c - -o tmpunwind.o && grep -qU -e eh_frame -e __unwind_info tmpunwind.o && echo E; rm -f tmpunwind.o"
> +      COMMAND bash -c "exec 2>/dev/null; echo 'extern void b(void);int a(void){b();return 0;}' | ${CMAKE_C_COMPILER} -c -x c - -o tmpunwind.o && { grep -qa -e eh_frame -e __unwind_info tmpunwind.o || grep -qU -e eh_frame -e __unwind_info tmpunwind.o; } && echo E; rm -f tmpunwind.o"
>       WORKING_DIRECTORY ${LUAJIT_SOURCE_DIR}
>       OUTPUT_VARIABLE TESTUNWIND
>       RESULT_VARIABLE TESTUNWIND_RC
> diff --git a/src/Makefile.original b/src/Makefile.original
> index 4d7cda3e..2d014e43 100644
> --- a/src/Makefile.original
> +++ b/src/Makefile.original
> @@ -344,7 +344,7 @@ ifeq (iOS,$(TARGET_SYS))
> else
>   ifeq (,$(findstring LJ_NO_UNWIND 1,$(TARGET_TESTARCH)))
>     # Find out whether the target toolchain always generates unwind tables.
> -    TARGET_TESTUNWIND=$(shell exec 2>/dev/null; echo 'extern void b(void);int a(void){b();return 0;}' | $(TARGET_CC) -c -x c - -o tmpunwind.o && grep -qU -e eh_frame -e __unwind_info tmpunwind.o && echo E; rm -f tmpunwind.o)
> +    TARGET_TESTUNWIND=$(shell exec 2>/dev/null; echo 'extern void b(void);int a(void){b();return 0;}' | $(TARGET_CC) -c -x c - -o tmpunwind.o && { grep -qa -e eh_frame -e __unwind_info tmpunwind.o || grep -qU -e eh_frame -e __unwind_info tmpunwind.o; } && echo E; rm -f tmpunwind.o)
>     ifneq (,$(findstring E,$(TARGET_TESTUNWIND)))
>       TARGET_XCFLAGS+= -DLUAJIT_UNWIND_EXTERNAL
>     endif
> -- 
> 2.37.0 (Apple Git-136)
> 



More information about the Tarantool-patches mailing list