[all-commits] [llvm/llvm-project] b6cc5d: [libLTO] Set data-sections by default in libLTO.

Quinn Pham via All-commits all-commits at lists.llvm.org
Wed Jul 27 07:39:52 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b6cc5ddc94780074e2a027e5c217a254a1b61b05
  Author: Quinn Pham <Quinn.Pham at ibm.com>
  Date:   2022-07-27 (Wed, 27 Jul 2022)

  Changed paths:
    M clang/lib/Driver/ToolChains/CommonArgs.cpp
    M clang/test/Driver/function-sections.c
    R clang/test/Driver/gold-lto-sections.c
    M llvm/lib/LTO/LTOCodeGenerator.cpp
    A llvm/test/LTO/PowerPC/data-sections-aix.ll
    A llvm/test/LTO/PowerPC/data-sections-linux.ll
    A llvm/test/LTO/PowerPC/lit.local.cfg

  Log Message:
  [libLTO] Set data-sections by default in libLTO.

This patch changes legacy LTO to set data-sections by default. The user can
explicitly unset data-sections. The reason for this patch is to match the
behaviour of lld and gold plugin. Both lld and gold plugin have data-sections on
by default.

This patch also fixes the forwarding of the clang options -fno-data-sections and
-fno-function-sections to libLTO. Now, when -fno-data/function-sections are
specified in clang, -data/function-sections=0 will be passed to libLTO to
explicitly unset data/function-sections.

Reviewed By: w2yehia, MaskRay

Differential Revision: https://reviews.llvm.org/D129401

More information about the All-commits mailing list