From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (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 B998B445320 for ; Thu, 9 Jul 2020 08:41:13 +0300 (MSK) Date: Thu, 9 Jul 2020 08:41:11 +0300 From: "Alexander V. Tikhonov" Message-ID: <20200709054111.GA25145@hpalx> References: <81870339991bd3f54fc532b631f48d8bf4aa2b57.1594039762.git.avtikhon@tarantool.org> <20200708113726.GH5559@tarantool.org> <20200708192200.vwd7thsmsjurdtql@tkn_work_nb> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200708192200.vwd7thsmsjurdtql@tkn_work_nb> Subject: Re: [Tarantool-patches] [PATCH v1] Block linker flag '--no-undefined' List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Turenko , Igor Munkin Cc: tarantool-patches@dev.tarantool.org Hi Alexander, thanks for the review, I've corrected the messages and checked the usage of the functions from test/CMakeLists.txt file. On Wed, Jul 08, 2020 at 10:22:00PM +0300, Alexander Turenko wrote: > > Minor: I reworded the message a bit: > > | Found that OpenSUSE toolchain adds '--no-undefined' linked flag leading > > Typo: linked -> linker. > Corrected. > > Strictly saying, I see no reason to fix the problem here. These changes > > are similar and one ought to add this "woodoo magic" line to every > > CMakeLists.txt used for building dynamic libraries using Lua C API. > > Since we are using to build these extensions can you make > > this change there? > > I missed this way. It should work, but we should care about not leaving > a test/foo subdirectory scope. I think it should be verified manually. I > would even add a comment regarding the macro behaviour: it affects > current cmake variable scope and so a user should care to don't use it > in a top level scope. > I've added the the message below to the test/CMakeLists.txt file just before the change: | # WARNING: This change affects current cmake variable scope and so | # a user should care to don't use it in a top level scope. Also I've checked all found fuctions from test/CMakeLists.txt file to be sure that its in use only in test/* scopes: $ for f in `grep "^function(" test/CMakeLists.txt | sed "s#^function(##g" | awk '{print($1)}'` ; do echo "========== Checking $f" ; grep -RI $f 2>/dev/null ; done ========== Checking build_module cmake/module.cmake:function(rebuild_module_api) src/CMakeLists.txt:rebuild_module_api(${api_headers}) test/app/CMakeLists.txt:build_module(loaderslib loaderslib.c) test/CMakeLists.txt:function(build_module module files) test/box/CMakeLists.txt:build_module(function1 function1.c) test/box/CMakeLists.txt:build_module(reload1 reload1.c) test/box/CMakeLists.txt:build_module(reload2 reload2.c) test/box/CMakeLists.txt:build_module(tuple_bench tuple_bench.c) test/app-tap/CMakeLists.txt:build_module(module_api module_api.c) ========== Checking build_lualib test/CMakeLists.txt:function(build_lualib lib sources) test/luajit-tap/lj-flush-on-trace/CMakeLists.txt:build_lualib(libflush libflush.c) test/luajit-tap/gh-4427-ffi-sandwich/CMakeLists.txt:build_lualib(libsandwich libsandwich.c) third_party/luajit/test/lj-flush-on-trace/CMakeLists.txt:build_lualib(libflush libflush.c) third_party/luajit/test/gh-4427-ffi-sandwich/CMakeLists.txt:build_lualib(libsandwich libsandwich.c) As seen above all usages of "Checking "are inside the test/ scope except "rebuild_module_api" which is not from the checking file, but from the src/CMakeLists.txt file and it not interesting for us. > Sadly, we cannot solve the problem with properties, because flags from > the LINK_FLAGS target property are added before > CMAKE_SHARED_LINKER_FLAGS flags and because there is no --no-undefined > counterpart linker option (there is `--undefined foo` to allow certain > symbols to be undefined, but is not what we need here). > Agree. > WBR, Alexander Turenko.