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 17F9C6C1AE; Tue, 18 May 2021 21:47:35 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 17F9C6C1AE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1621363655; bh=mwXt0NJVECCgqhdj48ACygnTFzjzFmkIiaGntqTTgac=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=h8KLM1j4+0pTEsh84cb+OZrA7M2pPEs9W2WGYaM3AOdCqQW5MaTJpWV+ulsu2ilR7 2mK7oiqgHzwBmAx8SKHEOS3BrEJKIqGMkmXM7C+CK9pM4BYdi9K8ceYlmrtpnLKXdL f+vDjE9flX6P99AetNbCkWIu9QKoVYDohSEdf0GI= Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (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 506336C1AE for ; Tue, 18 May 2021 21:47:31 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 506336C1AE Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1lj4kc-0002o5-0w; Tue, 18 May 2021 21:47:30 +0300 Date: Tue, 18 May 2021 21:47:28 +0300 To: Sergey Kaplun Message-ID: <20210518184728.GP3944@tarantool.org> References: <4dd97d6fbfb470d41e9ef5ad12492a0def664b2b.1620678384.git.imun@tarantool.org> <20210512215532.GE3944@tarantool.org> <20210517172157.GO3944@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.10.1 (2018-07-13) X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD91B019B01C53E51AF9418A6087D01078917D63D7C0371164600894C459B0CD1B9B466E91452A9E90EF99B5B826C50D604993BCDA55D175C4A46CE9711DA951506 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE788AD3E9728F968ABEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006374FBED2B83F5E00CA8638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B260EF41445443553891DCB1824CC19764AD368CDB2FD0D9CCD2E47CDBA5A96583C09775C1D3CA48CFCA5A41EBD8A3A0199FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C3CA5A41EBD8A3A0199FA2833FD35BB23DF004C906525384302BEBFE083D3B9BA71A620F70A64A45A98AA50765F79006372E808ACE2090B5E1725E5C173C3A84C3C5EA940A35A165FF2DBA43225CD8A89F616AD31D0D18CD5C35872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2AD77751E876CB595E8F7B195E1C9783167C056B691CA6256D792DD908DDF4B51 X-C1DE0DAB: 0D63561A33F958A59F84C7D105FB98E30DDCD5172E64EF155EB42B3DE08E4F93D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA752546FE575EB473F1410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D345DB600F8E858000F97AC58A976D386267E79B802B85E7D225B1DA89A293ACC287B095A8B412789FD1D7E09C32AA3244CEC6AFD562BDEFFB50B5341F5C6AE3060E8FBBEFAE1C4874C927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojdWksWVKfsTDDYAf3u40J7A== X-Mailru-Sender: 689FA8AB762F73936BC43F508A063822F405754C1388405E92523E88544FFDC5A7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E33667EA787935ED9F1B 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: Igor Munkin via Tarantool-patches Reply-To: Igor Munkin Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Sergey, On 18.05.21, Sergey Kaplun wrote: > Igor, > > On 17.05.21, Igor Munkin wrote: > > > > > Side note: Also I've seen that Mike uses OSX_DEPLOYMENT_TARGET variable. > > > > > Moreover, CMAKE_OSX_SYSROOT should "computed based on the > > > > > CMAKE_OSX_DEPLOYMENT_TARGET or the host platform" according to [4]. > > > > > And by itself, it means the minimum possible IOS version, where an > > > > > application may run [5]. May be we should fix this too with a separate > > > > > issue and patch (to protect users from building LuaJIT on ancient > > > > > devices)? > > > > > > > > Sorry, I don't get this one. What exactly is bothering you here? > > > > > > Just friendly reminder. It's not related to the patch. Just a side > > > note. :) I remembered about it only because it is part of OSX twists. > > > There is no need to do it in this patch, but maybe later? > > > > But I still don't get what we need to do... > > I suppose it will be nice to add CMAKE_OSX_DEPLOYMENT_TARGET. Like Mike > does in Makefile: MACOSX_DEPLOYMENT_TARGET is set to 10.4. In the > separate patch, of course. So what problem does this solve? BTW, this is dropped in the new version of LuaJIT Makefile[1]. > > > > > > > > > > > [1]: https://cmake.org/cmake/help/latest/manual/cmake-variables.7.html > > > > > [2]: https://cmake.org/cmake/help/v3.1/manual/cmake-variables.7.html > > > > > [3]: https://github.com/LuaJIT/LuaJIT/blob/8dc3cd6c84dfc81539604340b7884408e1c71d55/doc/install.html#L437 > > > > > [4]: https://cmake.org/cmake/help/v3.1/variable/CMAKE_OSX_SYSROOT.html > > > > > [5]: https://developer.apple.com/library/archive/documentation/ToolsLanguages/Conceptual/Xcode_Overview/WorkingwithTargets.html > > > > > > > > > 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="/tmp/blablabalblablbalalbla" -DLUA_USE_ASSERT=ON -DCMAKE_BUILD_TYPE=Debug > > > > 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="/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.cmake: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=11.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/testCCompiler.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=1 > > | /Library/Developer/CommandLineTools/usr/bin/cc -arch arm64 -isysroot /tmp -mmacosx-version-min=11.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.log". > > > > 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 "Сам себе злобный Буратино". 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, > > > | 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) > > > > > > > + 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. > > > > > > > > ================================================================================ > > > > > > > > [1]: https://gitlab.kitware.com/cmake/cmake/-/blob/master/Source/cmLocalGenerator.cxx#L1911-1916 > > > > [2]: https://gitlab.kitware.com/cmake/cmake/-/blob/master/Tests/FindPackageModeMakefileTest/CMakeLists.txt#L24-28 > > > > > > > > > > > > -- > > > > Best regards, > > > > IM > > > > > > [1]: https://cmake.org/cmake/help/v3.0/variable/CMAKE_OSX_SYSROOT.html > > > > > > -- > > > Best regards, > > > Sergey Kaplun > > > > -- > > Best regards, > > IM > > -- > Best regards, > Sergey Kaplun [1]: https://github.com/LuaJIT/LuaJIT/commit/8961a92 -- Best regards, IM