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 DE8AE6EC71; Sat, 27 Feb 2021 13:48:56 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org DE8AE6EC71 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1614422936; bh=sGIPcqSPcC8+Ho9ILI8VPtFjca2GFO9Kc/IzpWUzRgQ=; 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=onZjVkV5Fpbs2WuRLQGquXCl2ft2YynCwZtL0TAfzyt09ulfd/fHiFtMW4illKjHS MmjaH1ScyhExW/Dw6SBuSct8jB4LFATUqGtnjM+38fZ4Su4Hv3Mz2keC2bTt1rkqGQ HSvJZFtjEXm54CsghxPrlVPmX5f4poSuX+QjV1do= Received: from smtp63.i.mail.ru (smtp63.i.mail.ru [217.69.128.43]) (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 278FA6EC71 for ; Sat, 27 Feb 2021 13:48:55 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 278FA6EC71 Received: by smtp63.i.mail.ru with esmtpa (envelope-from ) id 1lFx9Z-0000Jo-Tc; Sat, 27 Feb 2021 13:48:54 +0300 Date: Sat, 27 Feb 2021 13:48:07 +0300 To: Igor Munkin Message-ID: <20210227104807.GB6842@root> References: <7cd42be38d86c832ecd4ba0f3edd7ae83aead7ad.1612291495.git.imun@tarantool.org> <20210211192336.GC9361@root> <20210216152830.GL5448@tarantool.org> <20210218095643.GA6842@root> <20210220191835.GB9042@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210220191835.GB9042@tarantool.org> X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9795828B892398B720FF7727D08DA7A588E6C33AE9CCC9B44182A05F538085040DB32D976207BF539608B007FD09AA61447135FC35DB5B0D4E131BEDD602312A6 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7A1DB0B089319D380EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637770CCD3A0ADFB7EEEA1F7E6F0F101C674E70A05D1297E1BBC6CDE5D1141D2B1C955621303245C2923932056F207FF7DA4092B07EDAC6C94F9FA2833FD35BB23D9E625A9149C048EE33AC447995A7AD18CB629EEF1311BF91D2E47CDBA5A96583BD4B6F7A4D31EC0BC014FD901B82EE079FA2833FD35BB23D27C277FBC8AE2E8B3A703B70628EAD7BA471835C12D1D977C4224003CC836476EC64975D915A344093EC92FD9297F6718AA50765F79006377870F476E0DB9443A7F4EDE966BC389F395957E7521B51C24C7702A67D5C33162DBA43225CD8A89F0A35B161A8BF67C157739F23D657EF2BB5C8C57E37DE458B4C7702A67D5C3316FA3894348FB808DB48C21F01D89DB561574AF45C6390F7469DAA53EE0834AAEE X-C1DE0DAB: 0D63561A33F958A509AA4195BCD6A9CA232C2FBB9BB302335096C4A3886FD312D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75968C9853642EB7C3410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34C1D376EF32BB0896A0A5DC734CE42F8FBF0318EA38A401F73A4B0A0B8E64221F0ADF3DCDA456C3AC1D7E09C32AA3244CC2F8A1E0A9CDBC8FE003E1949F1DE4C3A8CE788DE6831205FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojzT24cXffn6ze0Rgp2b2Tew== X-Mailru-Sender: 3B9A0136629DC91206CBC582EFEF4CB4100281F8B75FD1EC9202199C8D28A248FC3DE66DF6D7C3DDF2400F607609286E924004A7DEC283833C7120B22964430C52B393F8C72A41A89437F6177E88F7363CDA0F3B3F5B9367 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 2/5] build: replace GNU Make with CMake 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 Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Igor, LGTM, except a few nitpicks regarding to the commit message. On 20.02.21, Igor Munkin wrote: > Sergey, > > > > > > +if(CMAKE_LIBRARY_ARCHITECTURE) > > > > > + AppendFlags(TARGET_C_FLAGS -DLUA_MULTILIB='"lib/${CMAKE_LIBRARY_ARCHITECTURE}"') > > > > > +endif() > > > > > > > > What about `LUA_LMULTILIB`? > > > > > > > > Side note: should we provide `DESTDIR` or/and `MULTILIB` control variable > > > > like it does in Makefile.original? > > > > > > DESTDIR is supported out of the box in CMake. MULTILIB is "autodetected" > > > via CMake[1] (I hope, but never tried). Regardging LMULTILIB, I have no > > > idea what its purpose is. Do you? > > > > To configure default CPATH, IINM, see luaconf.h for details. > > My fault, ask you in a different way: how do you suppose to use it? For example, if I want to separate directories with Lua libraries and C libraries. May be it is the superfluous customization. If you think so, please add the notice that this option is not implemented in CMake, and users should use original Makefile. > > > > > > > diff --git a/cmake/SetTargetFlags.cmake b/cmake/SetTargetFlags.cmake > > > > > new file mode 100644 > > > > > index 0000000..260fc6b > > > > > --- /dev/null > > > > > +++ b/cmake/SetTargetFlags.cmake > > > > > > > I add some comments to the following chunk. > > > > | +if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") > > | + if(LUAJIT_ARCH STREQUAL "x64") > > > > Side note: I have a linking error with the original Makefile > > without `MACOSX_DEPLOYMENT_TARGET` specification: > > || LINK luajit > > || Undefined symbols for architecture x86_64: > > || "__Unwind_DeleteException", referenced from: > > || _lj_err_unwind_dwarf in libluajit.a(lj_err.o) > > || "__Unwind_GetCFA", referenced from: > > || _lj_err_unwind_dwarf in libluajit.a(lj_err.o) > > || "__Unwind_RaiseException", referenced from: > > || _lj_err_throw in libluajit.a(lj_err.o) > > || "__Unwind_SetGR", referenced from: > > || _lj_err_unwind_dwarf in libluajit.a(lj_err.o) > > || "__Unwind_SetIP", referenced from: > > || _lj_err_unwind_dwarf in libluajit.a(lj_err.o) > > || ld: symbol(s) not found for architecture x86_64 > > > > But nothing with CMake... > > Nonetheless, I suggest to safe the old Makefile behaviour to specify > > the minimum OS version (see [1]): > > There is no error in CMake. This behaviour is dropped in LuaJIT in scope > of this patch[1]. Why do we need to add this to CMake? I think, because it may influence configuration of the toolchain and flags. Let's return to this later if it really will become a problem. > > > > > > > > Feel free to ignore. > > Ignoring. > > > > > > > > | + AppendFlags(TARGET_SHARED_FLAGS -image_base 7fff04c4a000) > > > > Also I've found that this line produces warnings from linker like: > > > > || ld: warning: -seg1addr not 16384 byte aligned, rounding up > > > > So, I suggest the following solution for cmake and for the original > > Makefile (just add 8Kb): > > There is the same value in the build system of the vanilla LuaJIT[2], so > I leave everything intact. BTW, I see no warning on my Mac. This is why I mentioned Darwin version and add corresponding patch for the old Makefile too. Anyway, the linker can handle this by itself, so lets drop this as is. We can return to this with a new issue (inside our or LuaJIT repo). > > > > > > > > > > > > > > > -- > > > > > 2.25.0 > > > > > > > > > > > > > [1]: https://stackoverflow.com/questions/41773161/negate-boolean-variable-in-cmake > > > > [2]: https://cmake.org/pipermail/cmake/2015-July/061116.html > > > > [3]: https://cmake.org/cmake/help/latest/command/continue.html > > > > [4]: https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake > > > > > > > > -- > > > > Best regards, > > > > Sergey Kaplun > > > > > > [1]: https://cmake.org/cmake/help/v3.1/variable/CMAKE_LIBRARY_ARCHITECTURE.html > > > > > > -- > > > Best regards, > > > IM > > > > [1]: https://cmake.org/cmake/help/v3.14/envvar/MACOSX_DEPLOYMENT_TARGET.html > > > > -- > > Best regards, > > Sergey Kaplun > > [1]: https://github.com/LuaJIT/LuaJIT/commit/8961a92 > [2]: https://github.com/LuaJIT/LuaJIT/blob/v2.1/src/Makefile#L327 > [3]: https://cmake.org/cmake/help/latest/prop_tgt/VERSION.html#mach-o-versions > [4]: https://cmake.org/cmake/help/latest/prop_tgt/SOVERSION.html#mach-o-versions > > -- > Best regards, > IM -- Best regards, Sergey Kaplun