From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 2D79A6C1AE; Wed, 19 May 2021 15:40:23 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 2D79A6C1AE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1621428023; bh=Z/z/a7+WeqmH/95FPO/KrUms+UUQMZ4MtIw8aRDN6mE=; h=Date:In-Reply-To:To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=qF2/Wx+180hb986EnJ8QngrpAgIO2s2CPyG5vFmi8ooF4qV4cNxASDuhjshzvVTsz sj4VsCNxFQxLjV29XKt16oCa4AFmA2cZWj+KKbZB20f+l9Ou3ECpRYZc4vowkTs3d7 LOac44+e2FiJS8ny9jdpxR31AIff/ODFx23WxHMI= Received: from smtp58.i.mail.ru (smtp58.i.mail.ru [217.69.128.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id D7CC66C1AE for ; Wed, 19 May 2021 15:40:19 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D7CC66C1AE Received: by smtp58.i.mail.ru with esmtpa (envelope-from ) id 1ljLUo-0008Pc-NY; Wed, 19 May 2021 15:40:19 +0300 Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_86796EDB-87C6-4A66-A02E-2E055B3397FB" Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Date: Wed, 19 May 2021 15:40:17 +0300 In-Reply-To: <20210519113800.GQ3944@tarantool.org> To: Igor Munkin References: <4dd97d6fbfb470d41e9ef5ad12492a0def664b2b.1620678384.git.imun@tarantool.org> <20210512215532.GE3944@tarantool.org> <20210517172157.GO3944@tarantool.org> <20210518184728.GP3944@tarantool.org> <20210519113800.GQ3944@tarantool.org> X-Mailer: Apple Mail (2.3654.60.0.2.21) X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD91B019B01C53E51AF6F63A46F26EE68FD6CF19A7203B0589400894C459B0CD1B9813D57290C78C0E2F51C8BD03A7E708F4DA571B8DDC306D1BDDFA93EA4B3182B X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE785DAC9A352760686C2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6778DA827A17800CE7952C4D7BD0BF3359EA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38BD6CF32B5F8F9D404FF18FE950B297A08773783ABACC69A2BCC7F00164DA146DAFE8445B8C89999728AA50765F7900637F6B57BC7E64490618DEB871D839B7333395957E7521B51C2DFABB839C843B9C08941B15DA834481F8AA50765F7900637F6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA7E827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8BB07C9E286C61B7F975ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A5F6C6954140526DD43498EEB6A07D9200138D7F4C0BD600F6D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA752546FE575EB473F1410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D349A949488F6BF46DDBFA12AB222F501A3619FB997AF0AF8A633229513B8A6B40EAA23256910C7E7F81D7E09C32AA3244CCE48CFFA68C698B370352DC03CC12A519CA7333006C390A0FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojF35yOkZDoIVlf6xVU378wQ== X-Mailru-Sender: 3B9A0136629DC912F4AABCEFC589C81EAD08A7F18DE7F5EBFCB0189B26D5220144E8413A487B2B1AAD07DD1419AC565FA614486B47F28B67C5E079CCF3B0523AED31B7EB2E253A9E112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 1/3] build: pass sysroot to MacOS SDK X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Ostanevich via Tarantool-patches Reply-To: Sergey Ostanevich Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" --Apple-Mail=_86796EDB-87C6-4A66-A02E-2E055B3397FB Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi!=20 I believe we move from patch to two files originally +++ b/CMakeLists.txt +++ b/cmake/LuaJITUtils.cmake to just one, in 432cdf62303b0d609525acc84b01b92ae468d327 +++ b/cmake/LuaJITUtils.cmake I expect to see a =E2=80=98v2=E2=80=99 in such a case - for the = forthcoming patches. Anyways, if I read the correct patch above from the = imun/gh-5983-fix-build-on-m1 branch then it=E2=80=99s LGTM with just a typo fix. Sergos > On 19 May 2021, at 14:38, Igor Munkin wrote: >=20 > As a result of offline discussion with Sergey, I've finally understood > the docs and fixed the issue. Diff is below: >=20 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >=20 > diff --git a/cmake/LuaJITUtils.cmake b/cmake/LuaJITUtils.cmake > index 3497edc4..29c425de 100644 > --- a/cmake/LuaJITUtils.cmake > +++ b/cmake/LuaJITUtils.cmake > @@ -4,7 +4,12 @@ function(LuaJITTestArch outvar strflags) > # machinery) or explicitly (manually by configuration options). > # Need -isysroot flag on recentish MacOS after command line > # tools no longer provide headers in /usr/include. > - if(CMAKE_OSX_SYSROOT) > + # XXX: According to CMake documentation[1], CMAKE_OSX_SYSROOT > + # variable *should* be ignored on the plaforms other than MacOS. platforms > + # It is ignored by CMake, but since this routine is extension > + # it also should follow this policy. > + # [1]: = https://cmake.org/cmake/help/v3.1/variable/CMAKE_OSX_SYSROOT.html = > + if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_OSX_SYSROOT) > set(strflags "${strflags} -isysroot ${CMAKE_OSX_SYSROOT}") > endif() > # XXX: simply splits the COMMAND argument by >=20 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >=20 > On 18.05.21, Igor Munkin wrote: >> Sergey, >>=20 >=20 > >=20 >>=20 >>>>>> diff --git a/cmake/LuaJITUtils.cmake b/cmake/LuaJITUtils.cmake >>>>>> index d9f8b12a..3497edc4 100644 >>>>>> --- a/cmake/LuaJITUtils.cmake >>>>>> +++ b/cmake/LuaJITUtils.cmake >>>>>> @@ -1,4 +1,12 @@ >>>>>> function(LuaJITTestArch outvar strflags) >>>>>> + # XXX: This routine uses external headers (e.g. system ones), >>>>>> + # which location is specified either implicitly (within CMake >>>>>> + # machinery) or explicitly (manually by configuration = options). >>>>>> + # Need -isysroot flag on recentish MacOS after command line >>>>>> + # tools no longer provide headers in /usr/include. >>>>>> + if(CMAKE_OSX_SYSROOT) >>>>>=20 >>>>> Nit: This variable should be taken into account only for OS X >>>>> platforms [1]. I suppose not only by CMake, but by our build = system too. >>>>>=20 >>>>> I've got the error on Linux if I try to build LuaJIT like the = following >>>>> (by mistake of course): >>>>>=20 >>>>> | $ uname -s >>>>> | Linux >>>>> | $ cmake . -DCMAKE_OSX_SYSROOT=3D"/tmp/blablabalblablbalalbla" = -DLUA_USE_ASSERT=3DON -DCMAKE_BUILD_TYPE=3DDebug >>>>=20 >>>> Sigh. After all, I've tried for three patches, seems like ninety... >>>>=20 >>>> BTW, I see failures even on MacOS: >>>> | $ uname -msr >>>> | Darwin 20.3.0 arm64 >>>> | $ cmake . -DCMAKE_OSX_SYSROOT=3D"/tmp" >>>> | -- The C compiler identification is AppleClang 12.0.0.12000032 >>>> | -- Detecting C compiler ABI info >>>> | -- Detecting C compiler ABI info - failed >>>> | -- Check for working C compiler: = /Library/Developer/CommandLineTools/usr/bin/cc >>>> | -- Check for working C compiler: = /Library/Developer/CommandLineTools/usr/bin/cc - broken >>>> | CMake Error at = /opt/homebrew/Cellar/cmake/3.20.1/share/cmake/Modules/CMakeTestCCompiler.c= make:66 (message): >>>> | The C compiler >>>> | >>>> | "/Library/Developer/CommandLineTools/usr/bin/cc" >>>> | >>>> | is not able to compile a simple test program. >>>> | >>>> | It fails with the following output: >>>> | >>>> | Change Dir: = /Users/tntmac07.tarantool.i/imun/tarantool-luajit/CMakeFiles/CMakeTmp >>>> | >>>> | Run Build Command(s):/usr/bin/make -f Makefile = cmTC_da00c/fast && /Library/Developer/CommandLineTools/usr/bin/make -f = CMakeFiles/cmTC_da00c.dir/build.make CMakeFiles/cmTC_da00c.dir/build >>>> | Building C object CMakeFiles/cmTC_da00c.dir/testCCompiler.c.o >>>> | /Library/Developer/CommandLineTools/usr/bin/cc -arch arm64 = -isysroot /tmp -mmacosx-version-min=3D11.1 -MD -MT = CMakeFiles/cmTC_da00c.dir/testCCompiler.c.o -MF = CMakeFiles/cmTC_da00c.dir/testCCompiler.c.o.d -o = CMakeFiles/cmTC_da00c.dir/testCCompiler.c.o -c = /Users/tntmac07.tarantool.i/imun/tarantool-luajit/CMakeFiles/CMakeTmp/test= CCompiler.c >>>> | Linking C executable cmTC_da00c >>>> | /opt/homebrew/Cellar/cmake/3.20.1/bin/cmake -E = cmake_link_script CMakeFiles/cmTC_da00c.dir/link.txt --verbose=3D1 >>>> | /Library/Developer/CommandLineTools/usr/bin/cc -arch arm64 = -isysroot /tmp -mmacosx-version-min=3D11.1 -Wl,-search_paths_first = -Wl,-headerpad_max_install_names = CMakeFiles/cmTC_da00c.dir/testCCompiler.c.o -o cmTC_da00c >>>> | ld: library not found for -lSystem >>>> | clang: error: linker command failed with exit code 1 (use -v = to see invocation) >>>> | make[1]: *** [cmTC_da00c] Error 1 >>>> | make: *** [cmTC_da00c/fast] Error 2 >>>> | >>>> | >>>> | >>>> | >>>> | >>>> | CMake will not be able to correctly generate this project. >>>> | Call Stack (most recent call first): >>>> | CMakeLists.txt:12 (project) >>>> | >>>> | >>>> | -- Configuring incomplete, errors occurred! >>>> | See also = "/Users/tntmac07.tarantool.i/imun/tarantool-luajit/CMakeFiles/CMakeOutput.= log". >>>> | See also = "/Users/tntmac07.tarantool.i/imun/tarantool-luajit/CMakeFiles/CMakeError.l= og". >>>>=20 >>>> I have no idea how to fix this, so I propose to classify manual >>>> definition of CMAKE_OSX_SYSROOT as PEBKAC and move on. Thoughts? >>>=20 >>> Why we can't just change the check to the following? >>=20 >> For what? The problem still exists on MacOS. Furthermore, the problem >> with the same nature (from my point of view). >>=20 >>>=20 >>> | if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_OSX_SYSROOT) >>>=20 >>> At least it fixes the case I mentioned above, doesn't it? And we >>> definitely can't protect users from wrong sysroot paths on OS X = systems >>> like in your example. This case looks like "=D0=A1=D0=B0=D0=BC = =D1=81=D0=B5=D0=B1=D0=B5 =D0=B7=D0=BB=D0=BE=D0=B1=D0=BD=D1=8B=D0=B9 = =D0=91=D1=83=D1=80=D0=B0=D1=82=D0=B8=D0=BD=D0=BE". >>=20 >> Yes, it fixes. But it does not on MacOS. Hence, why do we need to = handle >> this only on Linux? Moreover, who will set CMAKE_OSX_SYSROOT (not for >> the testing reason) on Linux? There is even *OSX* in the variable = name. >> I am more concerned with the fact, one can break the build with this = on >> MacOS. Unfortunately, it seems in this case we can do nothing with = it. >>=20 >> Sorry, but I see no arguments for solving this particular case. >>=20 >> Ignoring. >>=20 >>>=20 >>>>=20 >>>>> | In file included from lua.h:14, >>>>> | from lj_arch.h:9: >>>>> | /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/include/stdint.h:9:16: = fatal error: stdint.h: No such file or directory >>>>> | 9 | # include_next >>>>> | | ^~~~~~~~~~ >>>>> | compilation terminated. >>>>> | CMake Error at cmake/LuaJITUtils.cmake:48 (message): >>>>> | [LuaJITArch] Unsupported target architecture >>>>> | Call Stack (most recent call first): >>>>> | cmake/SetTargetFlags.cmake:16 (LuaJITArch) >>>>> | src/CMakeLists.txt:17 (include) >>>>>=20 >>>>>> + set(strflags "${strflags} -isysroot ${CMAKE_OSX_SYSROOT}") >>>>>> + endif() >>>>>> # XXX: simply splits the COMMAND argument by >>>>>> # spaces with no further parsing. At the same time GCC is bad = in >>>>>> # argument handling, so let's help it a bit. >>>>>>=20 >>>>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>>>>=20 >>>>>> [1]: = https://gitlab.kitware.com/cmake/cmake/-/blob/master/Source/cmLocalGenerat= or.cxx#L1911-1916 >>>>>> [2]: = https://gitlab.kitware.com/cmake/cmake/-/blob/master/Tests/FindPackageMode= MakefileTest/CMakeLists.txt#L24-28 >>>>>>=20 >>>>>>=20 >>>>>> --=20 >>>>>> Best regards, >>>>>> IM >>>>>=20 >>>>> [1]: = https://cmake.org/cmake/help/v3.0/variable/CMAKE_OSX_SYSROOT.html >>>>>=20 >>>>> --=20 >>>>> Best regards, >>>>> Sergey Kaplun >>>>=20 >>>> --=20 >>>> Best regards, >>>> IM >>>=20 >>> --=20 >>> Best regards, >>> Sergey Kaplun >>=20 >> [1]: https://github.com/LuaJIT/LuaJIT/commit/8961a92 >>=20 >> --=20 >> Best regards, >> IM >=20 > --=20 > Best regards, > IM --Apple-Mail=_86796EDB-87C6-4A66-A02E-2E055B3397FB Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
Hi! 

I believe = we move from patch to two files originally
+++ = b/CMakeLists.txt
+++= b/cmake/LuaJITUtils.cmake

to just one, in = 432cdf62303b0d609525acc84b01b92ae468d327
+++ = b/cmake/LuaJITUtils.cmake

I expect to see a =E2=80=98v2=E2=80=99 = in such a case - for the forthcoming patches.

Anyways,= if I read the correct patch above from = the imun/gh-5983-fix-build-on-m1
branch then = it=E2=80=99s LGTM with just a typo fix.

Sergos


On 19 May 2021, at 14:38, Igor Munkin <imun@tarantool.org> = wrote:

As a result of offline discussion with Sergey, I've finally = understood
the docs and = fixed the issue. Diff is below:

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D

diff --git a/cmake/LuaJITUtils.cmake = b/cmake/LuaJITUtils.cmake
index 3497edc4..29c425de 100644
--- a/cmake/LuaJITUtils.cmake
+++ b/cmake/LuaJITUtils.cmake
@@ -4,7 +4,12 @@ function(LuaJITTestArch outvar = strflags)
  # = machinery) or explicitly (manually by configuration options).
  # = Need -isysroot flag on recentish MacOS after command line
  # = tools no longer provide headers in /usr/include.
- =  if(CMAKE_OSX_SYSROOT)
+  # XXX: According to CMake documentation[1], = CMAKE_OSX_SYSROOT
+  # variable *should* be ignored on the plaforms other = than MacOS.
=   platforms
+  # It is ignored by CMake, but since this routine is = extension
+  # it = also should follow this policy.
+  # [1]: https://cmake.org/cmake/help/v3.1/variable/CMAKE_OSX_SYSROOT.ht= ml
+ =  if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND = CMAKE_OSX_SYSROOT)
    set(strflags "${strflags} -isysroot = ${CMAKE_OSX_SYSROOT}")
  endif()
  # XXX: <execute_process> simply splits the = COMMAND argument by

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D

On 18.05.21, Igor Munkin wrote:
Sergey,


<snipped>


diff --git = a/cmake/LuaJITUtils.cmake b/cmake/LuaJITUtils.cmake
index = d9f8b12a..3497edc4 100644
--- a/cmake/LuaJITUtils.cmake
+++ b/cmake/LuaJITUtils.cmake
@@ -1,4 +1,12 = @@
function(LuaJITTestArch outvar strflags)
+ =  # XXX: This routine uses external headers (e.g. system ones),
+  # which location is specified either implicitly = (within CMake
+  # machinery) or explicitly (manually = by configuration options).
+  # Need -isysroot flag = on recentish MacOS after command line
+  # tools no = longer provide headers in /usr/include.
+ =  if(CMAKE_OSX_SYSROOT)

Nit:= This variable should be taken into account only for OS X
platforms [1]. I suppose not only by CMake, but by our build = system too.

I've got the error on Linux if = I try to build LuaJIT like the following
(by mistake of = course):

| $ uname -s
| = Linux
| $ cmake . = -DCMAKE_OSX_SYSROOT=3D"/tmp/blablabalblablbalalbla" -DLUA_USE_ASSERT=3DON = -DCMAKE_BUILD_TYPE=3DDebug

Sigh.= After all, I've tried for three patches, seems like ninety...

BTW, I see failures even on MacOS:
| $ uname -msr
| Darwin 20.3.0 arm64
| $ cmake . -DCMAKE_OSX_SYSROOT=3D"/tmp"
| -- = The C compiler identification is AppleClang 12.0.0.12000032
| -- Detecting C compiler ABI info
| -- = Detecting C compiler ABI info - failed
| -- Check for = working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
| -- Check for working C compiler: = /Library/Developer/CommandLineTools/usr/bin/cc - broken
| = CMake Error at = /opt/homebrew/Cellar/cmake/3.20.1/share/cmake/Modules/CMakeTestCCompiler.c= make:66 (message):
|   The C compiler
|
| =     "/Library/Developer/CommandLineTools/usr/bin/cc"|
|   is not able to compile a = simple test program.
|
|   It = fails with the following output:
|
| =     Change Dir: = /Users/tntmac07.tarantool.i/imun/tarantool-luajit/CMakeFiles/CMakeTmp
|
|     Run Build = Command(s):/usr/bin/make -f Makefile cmTC_da00c/fast && = /Library/Developer/CommandLineTools/usr/bin/make  -f = CMakeFiles/cmTC_da00c.dir/build.make CMakeFiles/cmTC_da00c.dir/build
|     Building C object = CMakeFiles/cmTC_da00c.dir/testCCompiler.c.o
| =     /Library/Developer/CommandLineTools/usr/bin/cc =   -arch arm64 -isysroot /tmp -mmacosx-version-min=3D11.1 -MD = -MT CMakeFiles/cmTC_da00c.dir/testCCompiler.c.o -MF = CMakeFiles/cmTC_da00c.dir/testCCompiler.c.o.d -o = CMakeFiles/cmTC_da00c.dir/testCCompiler.c.o -c = /Users/tntmac07.tarantool.i/imun/tarantool-luajit/CMakeFiles/CMakeTmp/test= CCompiler.c
|     Linking C executable = cmTC_da00c
| =     /opt/homebrew/Cellar/cmake/3.20.1/bin/cmake -E = cmake_link_script CMakeFiles/cmTC_da00c.dir/link.txt --verbose=3D1
| =     /Library/Developer/CommandLineTools/usr/bin/cc =  -arch arm64 -isysroot /tmp -mmacosx-version-min=3D11.1 = -Wl,-search_paths_first -Wl,-headerpad_max_install_names = CMakeFiles/cmTC_da00c.dir/testCCompiler.c.o -o cmTC_da00c
| =     ld: library not found for -lSystem
|=     clang: error: linker command failed with exit = code 1 (use -v to see invocation)
| =     make[1]: *** [cmTC_da00c] Error 1
| =     make: *** [cmTC_da00c/fast] Error 2
|
|
|
|
|
|   CMake will not be able to = correctly generate this project.
| Call Stack (most recent = call first):
|   CMakeLists.txt:12 (project)
|
|
| -- Configuring incomplete, = errors occurred!
| See also = "/Users/tntmac07.tarantool.i/imun/tarantool-luajit/CMakeFiles/CMakeOutput.= log".
| See also = "/Users/tntmac07.tarantool.i/imun/tarantool-luajit/CMakeFiles/CMakeError.l= og".

I have no idea how to fix this, so I = propose to classify manual
definition of CMAKE_OSX_SYSROOT = as PEBKAC and move on. Thoughts?

Why we can't just change the check to the following?

For what? The problem still = exists on MacOS. Furthermore, the problem
with the same = nature (from my point of view).


| if(CMAKE_SYSTEM_NAME STREQUAL = "Darwin" AND CMAKE_OSX_SYSROOT)

At least it = fixes the case I mentioned above, doesn't it? And we
definitely can't protect users from wrong sysroot paths on OS = X systems
like in your example. This case looks like = "=D0=A1=D0=B0=D0=BC =D1=81=D0=B5=D0=B1=D0=B5 =D0=B7=D0=BB=D0=BE=D0=B1=D0=BD= =D1=8B=D0=B9 =D0=91=D1=83=D1=80=D0=B0=D1=82=D0=B8=D0=BD=D0=BE".

Yes, it fixes. But it does not on = MacOS. Hence, why do we need to handle
this only on Linux? = Moreover, who will set CMAKE_OSX_SYSROOT (not for
the = testing reason) on Linux? There is even *OSX* in the variable name.
I am more concerned with the fact, one can break the build = with this on
MacOS. Unfortunately, it seems in this case = we can do nothing with it.

Sorry, but I see = no arguments for solving this particular case.

Ignoring.



| In file = included from lua.h:14,
| =             &n= bsp;    from lj_arch.h:9:
| = /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/include/stdint.h:9:16: fatal = error: stdint.h: No such file or directory
| =     9 | # include_next <stdint.h>
|       | =             &n= bsp;  ^~~~~~~~~~
| compilation terminated.
| CMake Error at cmake/LuaJITUtils.cmake:48 (message):
|   [LuaJITArch] Unsupported target architecture
| Call Stack (most recent call first):
| =   cmake/SetTargetFlags.cmake:16 (LuaJITArch)
| =   src/CMakeLists.txt:17 (include)

+ =    set(strflags "${strflags} -isysroot = ${CMAKE_OSX_SYSROOT}")
+  endif()
  # XXX: <execute_process> simply splits the = COMMAND argument by
  # spaces with no further = parsing. At the same time GCC is bad in
  # = argument handling, so let's help it a bit.

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D

[1]: https://gitlab.kitware.com/cmake/cmake/-/blob/master/Source/cmL= ocalGenerator.cxx#L1911-1916
[2]: https://gitlab.kitware.com/cmake/cmake/-/blob/master/Tests/Find= PackageModeMakefileTest/CMakeLists.txt#L24-28


-- 
Best = regards,
IM

[1]: = https://cmake.org/cmake/help/v3.0/variable/CMAKE_OSX_SYSROOT.ht= ml

-- 
Best = regards,
Sergey Kaplun

-- 
Best regards,
IM

-- 
Best regards,
Sergey Kaplun

[1]: https://github.com/LuaJIT/LuaJIT/commit/8961a92

-- 
Best = regards,
IM

-- 
Best = regards,
IM

= --Apple-Mail=_86796EDB-87C6-4A66-A02E-2E055B3397FB--