Tarantool development patches archive
 help / color / mirror / Atom feed
From: Olga Arkhangelskaia <arkholga@tarantool.org>
To: Alexander Turenko <alexander.turenko@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH] cmake: add LTO support for building luajit
Date: Mon, 29 Jun 2020 23:16:13 +0300	[thread overview]
Message-ID: <0f3b79f4-944a-c579-7cce-851f7dff1c68@tarantool.org> (raw)
In-Reply-To: <20200616183120.3dbhchwynjpv7fdp@tkn_work_nb>

Hi!

Thank you guys for the deep review and your patience.

I have fixed issues that you have underlined.

Added messages with options in case DENABLE_LTO=ON in order to see all 
flags that we enabling.

Checked with file/readelf and updated branch. So the patch(luajit part) 
looks like:

   diff --git a/cmake/luajit.cmake b/cmake/luajit.cmake
   index 10df633d5..555bc8371 100644
   --- a/cmake/luajit.cmake
   +++ b/cmake/luajit.cmake
   @@ -230,6 +230,16 @@ macro(luajit_build)
        # above.
        set (luajit_ld ${CMAKE_LINKER})
        set (luajit_ar ${CMAKE_AR} rcus)
   +    # Enablibg LTO for luajit if DENABLE_LTO set.
   +    if (ENABLE_LTO)
   +        message(STATUS "Enable LTO for luajit")
   +        set (luajit_ldflags ${luajit_ldflags} ${LDFLAGS_LTO})
   +        message(STATUS "ld: " ${luajit_ldflags})
   +        set (luajit_cflags ${luajit_cflags} ${CFLAGS_LTO})
   +        message(STATUS "cflags: " ${luajit_cflags})
   +        set (luajit_ar  ${AR_LTO} rcus)
   +        message(STATUS "ar: " ${luajit_ar})
   + endif()
        set (luajit_strip ${CMAKE_STRIP})
~


16.06.2020 21:31, Alexander Turenko пишет:
> My review is not sufficient anymore, since I wrote some parts of the
> code. Sergey, Timur, can you participate here?
>
>> Minimum compiler/linker versions: clang 3.4, gcc 5.0+, ld 2.27+ due
>> errors and slow work.
> It seems it is not actual anymore (at least for ld). If you want to
> highlight minimal requirements, I think it would be better to mention
> f9e28ce4602aff3f9bb4e743b0d6167b0f8df88d commit.
>
> Typo: Enablibg.
>
>> +    if (${ENABLE_LTO})
> No need to use ${var} inside if condition. See the surrounding code.
>
>> +`......message(STATUS "Enablig LTO for luajit")
>> +        set (luajit_ld ${CMAKE_C_LINK_OPTIONS_IPO})
> The variable is reassigned right below (it is why the build does not
> fail).
>
> It seems, you should find a way to verify that your changes actually
> enable LTO for luajit. Either by looking into actual compiler / linker
> options, or by looking into compiled code differences (say, find a cheap
> function in one compilation unit and verify that it is inlined into
> another one).
>
> It uses CMAKE_C_LINK_OPTIONS_IPO internal variable directly and ignores
> LDFLAGS_LTO that is set by lto.cmake. I suggest to use LDFLAGS_LTO.
>
> I guess you want to set luajit_ldflags, not luajit_ld.
>
> Use spaces for indent in CMake and Lua files. I guess all modern text
> editors may be properly configured to have different indent symbol /
> level for different file types.
>
> NB: I suggest to rebase your patchsets on top of master on each review
> iteration.
>
> ----
>
> I know, it is really hard to read the same code again and again when
> everything looks finished. But it is inevitable part of any development
> process due to the human nature: we do mistakes and should build
> processes that allow us to catch them.
>
> I suggest to introduce a personal self-review checklist that will grow
> with review comments from teammates.

  reply	other threads:[~2020-06-29 20:16 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-12 10:05 Olga Arkhangelskaia
2020-03-12 10:10 ` Cyrill Gorcunov
2020-04-14  9:18 ` Igor Munkin
2020-04-14  9:59   ` Olga Arkhangelskaia
2020-04-14 12:32   ` Olga Arkhangelskaia
2020-04-14 17:00     ` Igor Munkin
2020-04-15 13:22       ` Olga Arkhangelskaia
2020-04-17 11:47         ` Igor Munkin
2020-04-17 14:41           ` Olga Arkhangelskaia
2020-04-27 23:04             ` Igor Munkin
2020-05-06 10:47               ` Olga Arkhangelskaia
2020-04-14 14:33   ` Olga Arkhangelskaia
2020-05-25 12:58     ` Sergey Bronnikov
2020-05-25 15:00       ` Olga Arkhangelskaia
2020-05-25 15:12       ` Olga Arkhangelskaia
2020-05-25 15:43         ` Sergey Bronnikov
2020-05-26 10:11         ` Igor Munkin
2020-05-27 10:01           ` Olga Arkhangelskaia
2020-06-16  1:02 ` Alexander Turenko
2020-06-16 11:36   ` Olga Arkhangelskaia
2020-06-16 12:01     ` Olga Arkhangelskaia
2020-06-16 17:34     ` Alexander Turenko
2020-06-25  9:19       ` Timur Safin
2020-06-16 18:31     ` Alexander Turenko
2020-06-29 20:16       ` Olga Arkhangelskaia [this message]
2020-06-16 12:53   ` Igor Munkin
2020-06-25  9:45   ` Timur Safin
2020-06-25  9:47     ` Timur Safin
2020-07-08 12:23 ` Alexander Turenko
2020-07-08 12:34 ` Kirill Yukhin
2020-07-08 12:42   ` Kirill Yukhin
2020-07-08 12:38 ` Alexander Turenko
2020-07-09  5:13   ` Olga Arkhangelskaia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0f3b79f4-944a-c579-7cce-851f7dff1c68@tarantool.org \
    --to=arkholga@tarantool.org \
    --cc=alexander.turenko@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH] cmake: add LTO support for building luajit' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox