Changeset 71b4444 in mainline


Ignore:
Timestamp:
2023-10-22T16:59:42Z (7 months ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
78f0422c, dd7df1c
Parents:
590cb6d2 (diff), 2944b5a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge meson script updates for new toolchain

Files:
8 edited

Legend:

Unmodified
Added
Removed
  • kernel/meson.build

    r590cb6d2 r71b4444  
    8989        '-T', meson.current_build_dir() / '_link.ld',
    9090]
     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
    9194
    9295if CONFIG_LTO
     
    101104kernel_c_args = arch_kernel_c_args + kernel_defs + [
    102105        '-ffreestanding',
    103         # TODO: remove this flag
    104         cc.get_supported_arguments([ '-Wno-cast-function-type' ]),
     106
     107        cc.get_supported_arguments([
     108                # TODO: remove this flag
     109                '-Wno-cast-function-type',
     110
     111                # When accessing specific memory addresses that are below
     112                # normal page size, the compiler may assume that we actually
     113                # dereferenced NULL pointer and warns us about that.
     114                # But in kernel we often need to access these addresses
     115                # directly hence we need to ignore these warnings.
     116                #
     117                # TODO: might make more sense to disable this selectively
     118                # in specific files (or better yet, for specific lines).
     119                '--param=min-pagesize=0',
     120        ]),
    105121]
    106122
  • meson/arch/arm32/meson.build

    r590cb6d2 r71b4444  
    4242]
    4343
     44arch_kernel_c_args = arch_uspace_c_args + [ '-mno-unaligned-access', '-mfpu=vfpv3' ]
     45arch_kernel_c_args += cc.get_supported_arguments(['-mgeneral-regs-only' ])
     46arch_kernel_link_args = [ '-nostdlib', '-Wl,-z,max-page-size=0x1000' ]
     47
    4448if CONFIG_FPU
    45         # This is necessary for kernel too, to allow vmsr insn and fpexc manipulation.
    46         # Use vfp32 to allow context save/restore of d16-d31 regs.
    47         arch_uspace_c_args += [ '-mfloat-abi=hard' ]
     49    # Need to use softfp because our libgcc.a uses it too
     50    # softfp - generate code with soft-float calling conventions but allow use
     51    # of "hard" float instructions
     52    arch_uspace_c_args += [ '-mfloat-abi=softfp' ]
    4853endif
    49 
    50 arch_kernel_c_args = arch_uspace_c_args + [ '-mno-unaligned-access', '-mfpu=vfpv3' ]
    51 arch_kernel_link_args = [ '-nostdlib', '-Wl,-z,max-page-size=0x1000' ]
    5254arch_uspace_link_args = [ '-nostdlib', '-lgcc', '-Wl,-z,max-page-size=0x1000' ]
    5355
  • meson/arch/arm64/meson.build

    r590cb6d2 r71b4444  
    2828#
    2929
    30 arch_uspace_c_args = [ '-D__LE__', '-fno-omit-frame-pointer' ]
     30arch_uspace_c_args = [
     31        '-D__LE__',
     32        '-fno-omit-frame-pointer',
     33        cc.get_supported_arguments(['-mno-outline-atomics']),
     34]
    3135arch_kernel_c_args = arch_uspace_c_args + [ '-march=armv8-a+nofp+nosimd', '-mgeneral-regs-only' ]
    3236arch_kernel_link_args = [ '-nostdlib' ]
     
    4448# -mstrict-align option is therefore not needed.
    4549arch_boot_c_args = arch_uspace_c_args + [ '-fpic', '-fvisibility=hidden', '-fno-function-sections' ]
    46 arch_boot_link_args = [ '-Wl,-shared', '-Wl,--no-gc-sections' ]
     50arch_boot_link_args = [ '-Wl,-shared', '-Wl,--no-gc-sections' ] + ldflags_ignore_rwx_segments
    4751
    4852if MACHINE == 'virt'
  • meson/arch/ia64/meson.build

    r590cb6d2 r71b4444  
    3838arch_uspace_link_args = [ '-nostdlib', '-lgcc' ]
    3939arch_kernel_link_args = [ '-nostdlib', '-Wl,-EL' ]
    40 arch_boot_link_args = []
     40arch_boot_link_args = ldflags_ignore_rwx_segments
    4141
    4242
  • meson/arch/ppc32/meson.build

    r590cb6d2 r71b4444  
    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_boot_link_args = []
     39arch_uspace_link_args += ldflags_ignore_rwx_segments
     40arch_boot_link_args = ldflags_ignore_rwx_segments
    4041
    4142rd_essential += [
  • meson/arch/riscv64/meson.build

    r590cb6d2 r71b4444  
    3333arch_kernel_link_args = [ '-nostdlib' ]
    3434arch_uspace_link_args = [ '-nostdlib', '-lgcc' ]
    35 arch_boot_link_args = []
     35arch_boot_link_args = ldflags_ignore_rwx_segments
    3636
    3737rd_essential += [
  • meson/part/compiler_args/meson.build

    r590cb6d2 r71b4444  
    110110extra_cppflags = extra_common_flags + [
    111111        '-fno-exceptions',
     112        '-Wno-misleading-indentation',
    112113        '-frtti',
    113114]
     
    128129        add_project_link_arguments(extra_cflags, language : [ lang ])
    129130endforeach
     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
  • meson/part/tools/meson.build

    r590cb6d2 r71b4444  
    6161endif
    6262
     63# On some distributions (e.g. Arch Linux), genisoimage is actually a symbolic
     64# link to mkisofs. However, they do not accept exactly the same options.
     65# Thus we check if genisoimage is a symbolic link to mkisofs and if it is so,
     66# we switch to mkisofs as that is the native application available.
     67fs = import('fs')
    6368genisoimage = find_program('genisoimage', required: false)
    64 if genisoimage.found()
     69_mkisofs = find_program('mkisofs', required: false)
     70if genisoimage.found() and not (fs.is_symlink(genisoimage.full_path()) and _mkisofs.found() and fs.is_samepath(genisoimage.full_path(), _mkisofs.full_path()))
    6571        genisoimage_type = 'genisoimage'
    6672else
    67         genisoimage = find_program('mkisofs', required: false)
     73        genisoimage = _mkisofs
    6874        if genisoimage.found()
    6975                genisoimage_type = 'mkisofs'
Note: See TracChangeset for help on using the changeset viewer.