Changeset 068dd86 in mainline for meson


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

Support linker without —no-warn-rwx-segments

Location:
meson
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • meson/arch/arm64/meson.build

    r4dbcdf3 r068dd86  
    4444# -mstrict-align option is therefore not needed.
    4545arch_boot_c_args = arch_uspace_c_args + [ '-fpic', '-fvisibility=hidden', '-fno-function-sections' ]
    46 arch_boot_link_args = [ '-Wl,-shared', '-Wl,--no-gc-sections' ]
    47 arch_boot_link_args += ['-Wl,--no-warn-rwx-segments']
     46arch_boot_link_args = [ '-Wl,-shared', '-Wl,--no-gc-sections' ] + ldflags_ignore_rwx_segments
    4847
    4948if MACHINE == 'virt'
  • meson/arch/ia64/meson.build

    r4dbcdf3 r068dd86  
    3838arch_uspace_link_args = [ '-nostdlib', '-lgcc' ]
    3939arch_kernel_link_args = [ '-nostdlib', '-Wl,-EL' ]
    40 arch_boot_link_args = ['-Wl,--no-warn-rwx-segments']
     40arch_boot_link_args = ldflags_ignore_rwx_segments
    4141
    4242
  • meson/arch/ppc32/meson.build

    r4dbcdf3 r068dd86  
    3737arch_kernel_link_args = [ '-nostdlib', '-Wl,-z,max-page-size=0x1000', '-Wl,--no-check-sections', '-Wl,--no-gc-sections' ]
    3838arch_uspace_link_args = [ '-nostdlib', '-lgcc', '-Wl,-z,max-page-size=0x1000' ]
    39 arch_uspace_link_args += ['-Wl,--no-warn-rwx-segments']
    40 arch_boot_link_args = ['-Wl,--no-warn-rwx-segments']
     39arch_uspace_link_args += ldflags_ignore_rwx_segments
     40arch_boot_link_args = ldflags_ignore_rwx_segments
    4141
    4242
  • meson/arch/riscv64/meson.build

    r4dbcdf3 r068dd86  
    3333arch_kernel_link_args = [ '-nostdlib' ]
    3434arch_uspace_link_args = [ '-nostdlib', '-lgcc' ]
    35 arch_boot_link_args = ['-Wl,--no-warn-rwx-segments']
     35arch_boot_link_args = ldflags_ignore_rwx_segments
    3636
    3737rd_essential += [
  • meson/part/compiler_args/meson.build

    r4dbcdf3 r068dd86  
    129129        add_project_link_arguments(extra_cflags, language : [ lang ])
    130130endforeach
     131
     132# This flag is needed at several places, hence we define it here.
     133#
     134# For backwards compatibility we try to detect --no-warn-rwx-segments.
     135# However, the autodetection done by Meson also results in
     136# "cannot find entry symbol _start; defaulting to 00000000004000b0"
     137# thus the option is never supported alone. So when detecting we also
     138# specify --entry=main so that the stub source provided by Meson is build
     139# correctly.
     140ldflags_ignore_rwx_segments = []
     141if cc.has_link_argument('-Wl,--no-warn-rwx-segments,--entry=main')
     142    ldflags_ignore_rwx_segments += ['-Wl,--no-warn-rwx-segments']
     143endif
Note: See TracChangeset for help on using the changeset viewer.