[Tarantool-patches] [PATCH luajit v4 6/8] BSD: Fix build with BSD grep.

sergos sergos at tarantool.org
Tue Dec 6 00:46:07 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>
> 
> Thanks to carlocab.
> 
> (cherry picked from commit b9d523965b3f55b19345a1ed1ebc92e431747ce1)
> 
> The `-U` option makes grep process the temporary binary file as
> a binary instead of text, meaning that its contents are passed
> to grep verbatim.
> 
> 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 d99e1f9a..943a3152 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 -qa -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 -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 5826a56a..4d7cda3e 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 -qa -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 -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