[Tarantool-patches] [PATCH luajit 2/5] build: replace GNU Make with CMake

Igor Munkin imun at tarantool.org
Sun Feb 28 21:18:11 MSK 2021


Sergey,

On 27.02.21, Sergey Kaplun wrote:
> Igor,
> 
> LGTM, except a few nitpicks regarding to the commit message.

Thanks, added your tag:
| Reviewed-by: Sergey Kaplun <skaplun at tarantool.org>

> 

<snipped>

> > > > > > +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.

I added the notice and reworded the commit message the following way.
Hope it covers all your nits regarding new build system NYIs.
| build: replace GNU Make with CMake
|
| Within this patch the LuaJIT build system is partially ported from GNU
| Make to CMake. These changes provide CMake build system for all
| supported host architectures, but only for the following OS: GNU/Linux,
| OSX, FreeBSD. For other platforms, environment tweaking and specific
| builds (such as 'amalg', stripped binary and shared library,
| cross-compiling support) use the old build system (see the recipe in the
| previous commit).
|
| Several components of the new build system such as automatic version
| detection, source files list generation and some recipes for
| CMakeLists.txt are taken verbatim or adapted from LuaVela repository.
|
| Part of tarantool/tarantool#4862

> 

<snipped>

> 
> > 
> > > 
> > > | +    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).

You can start with creating an issue in LuaJIT queue, if the problem is
reproduced with vanilla build system.

> 

<snipped>

> > > > 
> > > > [1]: https://cmake.org/cmake/help/v3.1/variable/CMAKE_LIBRARY_ARCHITECTURE.html

<snipped>

> > [2]: https://github.com/LuaJIT/LuaJIT/blob/v2.1/src/Makefile#L327

<snipped>

> -- 
> Best regards,
> Sergey Kaplun

-- 
Best regards,
IM


More information about the Tarantool-patches mailing list