Changeset 068dd86 in mainline for kernel/meson.build


Ignore:
Timestamp:
2023-08-04T13:07:34Z (10 months ago)
Author:
Vojtech Horky <vojtech.horky@…>
Branches:
ticket/834-toolchain-update
Children:
24cf6694
Parents:
4dbcdf3
Message:

Support linker without —no-warn-rwx-segments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/meson.build

    r4dbcdf3 r068dd86  
    8787kernel_link_args = arch_kernel_link_args + [
    8888        '-Wl,--nmagic',
    89         # The kernel is built as ELF but then copied as a blob of bytes and
    90         # the permissions are not relevant anyway (needed for binutils 2.39+).
    91         '-Wl,--no-warn-rwx-segments',
    9289        '-T', meson.current_build_dir() / '_link.ld',
    9390]
     91# The kernel is built as ELF but then copied as a blob of bytes and
     92# the permissions are not relevant anyway (needed for binutils 2.39+).
     93kernel_link_args += ldflags_ignore_rwx_segments
    9494
    9595if CONFIG_LTO
     
    104104kernel_c_args = arch_kernel_c_args + kernel_defs + [
    105105        '-ffreestanding',
    106         # When accessing specific memory addresses that are below normal page size,
    107         # the compiler may assume that we actually dereferenced NULL pointer and
    108         # warns us about that. But in kernel we often need to access these
    109         # addresses directly hence we need to ignore these warnings.
    110         #
    111         # TODO: might make more sense to disable this selectively in specific
    112         # files (or better yet, for specific lines).
    113         '--param=min-pagesize=0',
    114         # TODO: remove this flag
    115         cc.get_supported_arguments([ '-Wno-cast-function-type' ]),
     106        cc.get_supported_arguments([
     107                # TODO: remove this flag
     108                '-Wno-cast-function-type',
     109                # When accessing specific memory addresses that are below normal page
     110                # size, the compiler may assume that we actually dereferenced NULL
     111                # pointer and warns us about that. But in kernel we often need to
     112                # access these addresses directly hence we need to ignore these
     113                # warnings.
     114                #
     115                # TODO: might make more sense to disable this selectively in specific
     116                # files (or better yet, for specific lines).
     117                '--param=min-pagesize=0',
     118        ]),
    116119]
    117120
Note: See TracChangeset for help on using the changeset viewer.