Ticket #6310: buildsystem.patch

File buildsystem.patch, 42.3 KB (added by mmlr, 9 years ago)
  • build/jam/BootloaderRules

     
     1
     2rule SetupBoot
     3{
     4    # Usage SetupBoot <sources_or_objects> : <extra_cc_flags> : <include_private_headers> ;
     5    #
     6    # <sources_or_objects> - Ideally sources, otherwise HDRSEARCH can not be
     7    #                        set for the sources and the sources some header
     8    #                        dependencies might be missing.
     9
     10    local sources = [ FGristFiles $(1) ] ;
     11    local objects = $(sources:S=$(SUFOBJ)) ;
     12
     13    # add private kernel headers
     14    if $(3) != false {
     15        SourceSysHdrs $(sources) : $(TARGET_PRIVATE_KERNEL_HEADERS) ;
     16    }
     17
     18    local object ;
     19    for object in $(objects) {
     20        # add kernel flags for the object
     21
     22        ObjectCcFlags $(object) : $(TARGET_BOOT_CCFLAGS) $(2) ;
     23        ObjectC++Flags $(object) : $(TARGET_BOOT_C++FLAGS) $(2) ;
     24        ObjectDefines $(object) : $(TARGET_KERNEL_DEFINES) ;
     25
     26        # override warning flags
     27        TARGET_WARNING_CCFLAGS on $(object) = $(TARGET_KERNEL_WARNING_CCFLAGS) ;
     28        TARGET_WARNING_C++FLAGS on $(object)
     29            = $(TARGET_KERNEL_WARNING_C++FLAGS) ;
     30    }
     31}
     32
     33rule BootObjects
     34{
     35    SetupBoot $(1) : $(2) ;
     36    Objects $(1) ;
     37}
     38
     39rule BootLd
     40{
     41    # KernelLd <name> : <objs> : <linkerscript> : <args> ;
     42
     43    LINK on $(1) = $(TARGET_LD) ;
     44
     45    LINKFLAGS on $(1) = $(4) ;
     46    if $(3) { LINKFLAGS on $(1) += --script=$(3) ; }
     47
     48    LINKFLAGS on $(1) += $(TARGET_BOOT_LINKFLAGS) ;
     49
     50    # Remove any preset LINKLIBS, but link against libgcc.a
     51    # TODO: In configure and buildsetup add code to setup a TARGET_STATIC_LEGACY_LIBSUP++ varible
     52    if $(HAIKU_ARCH) = x86_64 {
     53        LINKLIBS on $(1) = generated/cross-tools/x86_64-pc-haiku/lib/legacy/libsupc++.a $(TARGET_GCC_LEGACY_LIBGCC) ;
     54    }
     55    else
     56    {
     57        LINKLIBS on $(1) = $(TARGET_STATIC_LIBSUPC++) $(TARGET_GCC_LIBGCC) ;
     58    }
     59
     60    # TODO: Do we really want to invoke SetupKernel here? The objects should
     61    # have been compiled with KernelObjects anyway, so we're doing that twice.
     62    SetupBoot $(2) ;
     63
     64    # Show that we depend on the libraries we need
     65    LocalClean clean : $(1) ;
     66    LocalDepends all : $(1) ;
     67    Depends $(1) : $(2) ;
     68
     69    MakeLocateDebug $(1) ;
     70
     71    on $(1) XRes $(1) : $(RESFILES) ;
     72    if ! [ on $(1) return $(DONT_USE_BEOS_RULES) ] {
     73        SetType $(1) ;
     74        MimeSet $(1) ;
     75        SetVersion $(1) ;
     76    }
     77}
     78
     79actions BootLd bind VERSION_SCRIPT
     80{
     81    $(LINK) $(LINKFLAGS) -o "$(1)" "$(2)" $(LINKLIBS) \
     82        --version-script=$(VERSION_SCRIPT)
     83}
     84
     85rule BootMergeObject
     86{
     87    # BootMergeObject <name> : <sources> : <extra CFLAGS> : <other objects> ;
     88    # Compiles source files and merges the object files to an object file.
     89    # <name>: Name of the object file to create. No grist will be added.
     90    # <sources>: Sources to be compiled. Grist will be added.
     91    # <extra CFLAGS>: Additional flags for compilation.
     92    # <other objects>: Object files or static libraries to be merged. No grist
     93    #                  will be added.
     94    #
     95
     96    SetupBoot $(2) : $(3) ;
     97    Objects $(2) ;
     98    MergeObjectFromObjects $(1) : $(2:S=$(SUFOBJ)) : $(4) ;
     99}
     100
     101rule BootStaticLibrary
     102{
     103    # Usage BootStaticLibrary <name> : <sources> : <extra cc flags>  ;
     104    # This is designed to take a set of sources and libraries and create
     105    # a file called lib<name>.a
     106
     107    SetupBoot $(2) : $(3) : false ;
     108    Library $(1) : $(2) ;
     109}
     110
     111rule BootStaticLibraryObjects
     112{
     113    # Usage BootStaticLibrary <name> : <sources> ;
     114    # This is designed to take a set of sources and libraries and create
     115    # a file called <name>
     116
     117    # Show that we depend on the libraries we need
     118    SetupBoot $(2) ;
     119    LocalClean clean : $(1) ;
     120    LocalDepends all : $(1) ;
     121    Depends $(1) : $(2) ;
     122
     123    MakeLocateDebug $(1) ;
     124}
     125
     126actions BootStaticLibraryObjects
     127{
     128    # Force recreation of the archive to avoid build errors caused by
     129    # stale dependencies after renaming or deleting object files.
     130    $(RM) "$(1)"
     131    $(HAIKU_AR) -r "$(1)" "$(2)" ;
     132}
  • build/jam/MainBuildRules

     
    363363        } else {
    364364            LINK on $(1) = $(TARGET_LD) ;
    365365            LINKFLAGS on $(target) = $(TARGET_LDFLAGS) ;
     366            if $(DEFINES) = _BOOT_MODE {
     367                LINKFLAGS on $(1) += $(TARGET_BOOT_LINKFLAGS) ;
     368            }
    366369        }
    367370    }
    368371
  • build/jam/BuildSetup

     
    162162HAIKU_C++ ?= $(HAIKU_CC) ;
    163163HAIKU_LINK = $(HAIKU_CC) ;
    164164HAIKU_LINKFLAGS = $(HAIKU_GCC_BASE_FLAGS) ;
     165HAIKU_BOOT_LINKFLAGS = ;
    165166
    166167HAIKU_HDRS = [ FStandardHeaders ] ;
    167168HAIKU_CCFLAGS = $(HAIKU_GCC_BASE_FLAGS) -nostdinc ;
    168169HAIKU_C++FLAGS = $(HAIKU_GCC_BASE_FLAGS) -nostdinc ;
    169170HAIKU_KERNEL_CCFLAGS = $(HAIKU_GCC_BASE_FLAGS) ;
    170171HAIKU_KERNEL_C++FLAGS = $(HAIKU_GCC_BASE_FLAGS) ;
     172HAIKU_BOOT_CCFLAGS = $(HAIKU_GCC_BASE_FLAGS) ;
     173HAIKU_BOOT_C++FLAGS = $(HAIKU_GCC_BASE_FLAGS) ;
    171174HAIKU_DEFINES = __HAIKU__ ;
    172175HAIKU_NO_WERROR ?= 0 ;
    173176
     
    252255    }
    253256    case x86_64 :
    254257    {
    255         HAIKU_DEFINES += __x86_64__ ;
    256258        HAIKU_BOOT_PLATFORM = bios_ia32 ;
    257259        HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 2880 ; # in kB
    258260        # offset in floppy image (>= sizeof(haiku_loader))
    259261        HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 300 ; # in kB
     262        HAIKU_NO_WERROR = 1 ;
    260263
    261264        # yasm is required for target arch x86_64
    262265        if ! $(HAIKU_YASM) {
     
    314317# C/C++ flags
    315318HAIKU_KERNEL_CCFLAGS += -finline -fno-builtin ;
    316319HAIKU_KERNEL_C++FLAGS += -finline -fno-builtin -fno-exceptions ;
     320HAIKU_BOOT_CCFLAGS += -finline -fno-builtin ;
     321HAIKU_BOOT_C++FLAGS += -finline -fno-builtin -fno-exceptions ;
    317322HAIKU_KERNEL_DEFINES += _KERNEL_MODE ;
    318323
    319324if $(HAIKU_GCC_VERSION[1]) >= 3 {
     
    341346        HAIKU_KERNEL_PIC_CCFLAGS = -fPIE ;
    342347        HAIKU_KERNEL_PIC_LINKFLAGS = -shared -fPIE ;
    343348    }
    344 
    345349    case m68k :
    346350    {
    347351        # We don't want to have to handle emulating missing FPU opcodes for 040
     
    363367    }
    364368    case x86_64 :
    365369    {
     370        HAIKU_KERNEL_PIC_LINKFLAGS += -z max-page-size=0x1000 ;
     371
     372        HAIKU_KERNEL_CCFLAGS += -mcmodel=large ;
     373        HAIKU_KERNEL_C++FLAGS += -mcmodel=large ;
     374
     375        HAIKU_BOOT_LINKFLAGS += -m elf_i386_haiku ;
     376        HAIKU_BOOT_CCFLAGS += -m32 ;
     377        HAIKU_BOOT_C++FLAGS += -m32 ;
     378
    366379        # Enable use of the gcc built-in atomic functions instead of atomic_*().
    367380        # The former are inlined and have thus less overhead.
    368381        HAIKU_DEFINES += B_USE_BUILTIN_ATOMIC_FUNCTIONS ;
     
    917930    KERNEL_DEFINES
    918931
    919932    KERNEL_CCFLAGS KERNEL_C++FLAGS
     933    BOOT_CCFLAGS BOOT_C++FLAGS BOOT_LINKFLAGS
    920934    KERNEL_PIC_CCFLAGS KERNEL_PIC_LINKFLAGS
    921935    WARNING_CCFLAGS WARNING_C++FLAGS
    922936
     
    933947    PRIVATE_SYSTEM_HEADERS
    934948
    935949    LIBSTDC++ LIBSUPC++
    936     STATIC_LIBSTDC++ STATIC_LIBSUPC++
     950    STATIC_LIBSTDC++ STATIC_LIBSUPC++ STATIC_LEGACY_LIBSUPC++
    937951
    938952    NETWORK_LIBS NETAPI_LIB SELECT_UNAME_ETC_LIB
    939953
     
    952966    TARGET_GCC_LIB_DIR          = $(HAIKU_GCC_LIB_DIR) ;
    953967    TARGET_GCC_HEADERS_DIR      = $(HAIKU_GCC_HEADERS_DIR) ;
    954968    TARGET_GCC_LIBGCC           = $(HAIKU_GCC_LIBGCC) ;
     969    TARGET_GCC_LEGACY_LIBGCC    = $(HAIKU_GCC_LEGACY_LIBGCC) ;
    955970    TARGET_GCC_LIBGCC_OBJECTS   = $(HAIKU_GCC_LIBGCC_OBJECTS) ;
    956971
    957972    TARGET_BOOT_PLATFORM        ?= $(HAIKU_BOOT_PLATFORM) ;
     
    968983    TARGET_GCC_LIB_DIR          = ;
    969984    TARGET_GCC_HEADERS_DIR      = ;
    970985    TARGET_GCC_LIBGCC           = ;
     986    TARGET_GCC_LEGACY_LIBGCC    = ;
    971987    TARGET_GCC_LIBGCC_OBJECTS   = ;
    972988
    973989    TARGET_BOOT_PLATFORM        = ;
  • build/jam/OverriddenJamRules

     
    178178    local includesSeparator ;
    179179    local localIncludesOption ;
    180180    local systemIncludesOption ;
     181
     182    if $(DEFINES) = _BOOT_MODE {
     183        flags = $(TARGET_BOOT_CCFLAGS) ;
     184    }
     185
    181186    if [ on $(1) return $(PLATFORM) ] = host {
    182         flags = [ on $(1) return $(HOST_ASFLAGS) $(ASFLAGS) ] ;
     187        flags += [ on $(1) return $(HOST_ASFLAGS) $(ASFLAGS) ] ;
    183188
    184189        CC on $(1) = $(HOST_CC) ;
    185190
     
    188193        systemIncludesOption = $(HOST_SYSTEM_INCLUDES_OPTION) ;
    189194
    190195    } else {
    191         flags = [ on $(1) return $(TARGET_ASFLAGS) $(ASFLAGS) ] ;
     196        flags += [ on $(1) return $(TARGET_ASFLAGS) $(ASFLAGS) ] ;
    192197
    193198        CC on $(1) = $(TARGET_CC) ;
    194199
  • configure

     
    161161
    162162    HAIKU_GCC_LIB_DIR=${gccdir}
    163163    HAIKU_GCC_LIBGCC=${gccdir}/libgcc.a
     164    HAIKU_GCC_LEGACY_LIBGCC=${gccdir}/legacy/libgcc.a
    164165    HAIKU_GCC_GLUE_CODE="crtbegin.o crtend.o"
    165166    HAIKU_GCC_HEADERS_DIR="${gccdir}/include
    166167        ${gccdir}/include-fixed"
     
    554555HAIKU_GCC_LIB_DIR           ?= ${HAIKU_GCC_LIB_DIR} ;
    555556HAIKU_GCC_HEADERS_DIR       ?= ${HAIKU_GCC_HEADERS_DIR} ;
    556557HAIKU_GCC_LIBGCC            ?= ${HAIKU_GCC_LIBGCC} ;
     558HAIKU_GCC_LEGACY_LIBGCC         ?= ${HAIKU_GCC_LEGACY_LIBGCC} ;
    557559
    558560HAIKU_STATIC_LIBSTDC++      ?= ${HAIKU_STATIC_LIBSTDCXX} ;
    559561HAIKU_SHARED_LIBSTDC++      ?= ${HAIKU_SHARED_LIBSTDCXX} ;
  • Jamrules

     
    4242include [ FDirName $(HAIKU_BUILD_RULES_DIR) FreetypeRules ] ;
    4343include [ FDirName $(HAIKU_BUILD_RULES_DIR) HeadersRules ] ;
    4444include [ FDirName $(HAIKU_BUILD_RULES_DIR) KernelRules ] ;
     45include [ FDirName $(HAIKU_BUILD_RULES_DIR) BootloaderRules ] ;
    4546include [ FDirName $(HAIKU_BUILD_RULES_DIR) ImageRules ] ;
    4647include [ FDirName $(HAIKU_BUILD_RULES_DIR) CDRules ] ;
    4748include [ FDirName $(HAIKU_BUILD_RULES_DIR) MainBuildRules ] ;
  • src/system/kernel/lib/arch/x86_64/Jamfile

     
     1SubDir HAIKU_TOP src system kernel lib arch x86_64 ;
     2
     3# find the generated asm_offsets.h
     4SubDirHdrs [ FDirName $(TARGET_COMMON_DEBUG_OBJECT_DIR) system kernel arch
     5    $(TARGET_ARCH) ] ;
     6
     7SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) generic ] ;
     8
     9local librootSources = [ FDirName $(HAIKU_TOP) src system libroot ] ;
     10local posixSources = [ FDirName $(librootSources) posix ] ;
     11
     12SEARCH_SOURCE += [ FDirName $(librootSources) os arch $(TARGET_ARCH) ] ;
     13
     14KernelMergeObject kernel_os_arch_$(TARGET_ARCH).o :
     15    atomic.S
     16    byteorder.S
     17    system_time_asm.S
     18    system_time.c
     19
     20    : $(TARGET_KERNEL_PIC_CCFLAGS)
     21;
     22
     23SEARCH_SOURCE += [ FDirName $(posixSources) arch $(TARGET_ARCH) ] ;
     24SEARCH_SOURCE += [ FDirName $(posixSources) string arch generic ] ;
     25
     26KernelMergeObject kernel_lib_posix_arch_$(TARGET_ARCH).o :
     27    siglongjmp.S
     28    sigsetjmp.S
     29    kernel_longjmp_return.c
     30    kernel_setjmp_save_sigs.c
     31
     32    arch_string.S
     33
     34    : $(TARGET_KERNEL_PIC_CCFLAGS)
     35;
     36
     37# Explicitly tell the build system that arch_string.S includes the generated
     38# asm_offsets.h.
     39Includes [ FGristFiles arch_string.S ]
     40    : <src!system!kernel!arch!x86_64>asm_offsets.h ;
  • src/system/kernel/arch/x86_64/Jamfile

     
     1SubDir HAIKU_TOP src system kernel arch x86_64 ;
     2
     3SubDirHdrs $(SUBDIR) $(DOTDOT) generic ;
     4UsePrivateKernelHeaders ;
     5
     6
     7SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) generic ] ;
     8SEARCH_SOURCE += [ FDirName $(SUBDIR) timers ] ;
     9
     10
     11local x86_kernel_arch_sources =
     12    arch_real_time_clock.cpp
     13;
     14
     15
     16local x86_64_paging_sources =
     17    X86_64PagingMethod.cpp
     18    X86_64PagingStructures.cpp
     19    X86_64VMTranslationMap.cpp
     20
     21    x86_64_physical_page_mapper.cpp
     22    x86_64_physical_page_mapper_large_memory.cpp
     23;
     24
     25
     26KernelMergeObject kernel_arch_x86_64.o :
     27    entry.S
     28    arch_x86_64.S
     29    arch_interrupts.S
     30    cpuid.S
     31    asm_offsets.cpp
     32
     33    apic.cpp
     34
     35    arch_commpage.cpp
     36    arch_cpu.cpp
     37    arch_debug_console.cpp
     38    arch_debug.cpp
     39    arch_elf.cpp
     40    arch_int.cpp
     41    arch_platform.cpp
     42    arch_smp.cpp
     43    arch_system_info.cpp
     44    arch_thread.cpp
     45    arch_timer.cpp
     46    arch_user_debugger.cpp
     47    arch_vm.cpp
     48    arch_vm_translation_map.cpp
     49
     50    $(x86_kernel_arch_sources)
     51
     52# timers
     53    x86_64_apic.cpp
     54    x86_64_hpet.cpp
     55    x86_64_pit.cpp
     56
     57# system paging
     58    $(x86_64_paging_sources)
     59
     60    :
     61    $(TARGET_KERNEL_PIC_CCFLAGS)
     62    :
     63
     64;
     65
     66CreateAsmStructOffsetsHeader asm_offsets.h : asm_offsets.cpp ;
     67
     68SEARCH on [ FGristFiles $(x86_kernel_arch_sources) ]
     69    = [ FDirName $(SUBDIR) $(DOTDOT) x86 ] ;
     70
     71SEARCH on [ FGristFiles $(x86_64_paging_sources) ]
     72    = [ FDirName $(SUBDIR) paging ] ;
  • src/system/boot/platform/routerboard_mipsel/Jamfile

     
    2424#   video_rle.cpp
    2525;
    2626
    27 KernelMergeObject boot_platform_routerboard_mipsel.o :
     27BootMergeObject boot_platform_routerboard_mipsel.o :
    2828    console.cpp
    2929    cpu.cpp
    3030    debug.c
  • src/system/boot/platform/amiga_m68k/Jamfile

     
    1919
    2020#SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons accelerants common ] ;
    2121
    22 KernelMergeObject boot_platform_amiga_m68k_shell.o :
     22BootMergeObject boot_platform_amiga_m68k_shell.o :
    2323    shell.S
    2424    : -Wa,--pcrel
    2525;
     
    2727# cpu-specific stuff
    2828# should be moved to boot/arch/m68k/...
    2929# XXX: add 020+68851 support
    30 KernelMergeObject boot_arch_m68k_030.o :
     30BootMergeObject boot_arch_m68k_030.o :
    3131    mmu_030.cpp
    3232    : -fno-pic -Wno-unused -m68030
    3333;
    3434
    35 KernelMergeObject boot_arch_m68k_040.o :
     35BootMergeObject boot_arch_m68k_040.o :
    3636    mmu_040.cpp
    3737    : -fno-pic -Wno-unused -m68040
    3838;
    3939
    40 KernelMergeObject boot_arch_m68k_060.o :
     40BootMergeObject boot_arch_m68k_060.o :
    4141    mmu_060.cpp
    4242    : -fno-pic -Wno-unused -m68060
    4343;
    4444
    4545
    46 KernelMergeObject boot_platform_amiga_m68k_other.o :
     46BootMergeObject boot_platform_amiga_m68k_other.o :
    4747#   shell.S
    4848    start.c
    4949    toscalls.c
     
    7373    : -fno-pic #-Wa,--pcrel
    7474;
    7575
    76 KernelMergeObject boot_platform_amiga_m68k.o :
     76BootMergeObject boot_platform_amiga_m68k.o :
    7777    : :
    7878    boot_platform_amiga_m68k_shell.o
    7979    boot_platform_amiga_m68k_other.o
  • src/system/boot/platform/atari_m68k/Jamfile

     
    1919
    2020#SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons accelerants common ] ;
    2121
    22 KernelMergeObject boot_platform_atari_m68k_shell.o :
     22BootMergeObject boot_platform_atari_m68k_shell.o :
    2323    shell.S
    2424    : -Wa,--pcrel
    2525;
     
    2727# cpu-specific stuff
    2828# should be moved to boot/arch/m68k/...
    2929# TODO: add 020+68851 support
    30 KernelMergeObject boot_arch_m68k_030.o :
     30BootMergeObject boot_arch_m68k_030.o :
    3131    mmu_030.cpp
    3232    : -fno-pic -Wno-unused -m68030
    3333;
    3434
    35 KernelMergeObject boot_arch_m68k_040.o :
     35BootMergeObject boot_arch_m68k_040.o :
    3636    mmu_040.cpp
    3737    : -fno-pic -Wno-unused -m68040
    3838;
    3939
    40 KernelMergeObject boot_arch_m68k_060.o :
     40BootMergeObject boot_arch_m68k_060.o :
    4141    mmu_060.cpp
    4242    : -fno-pic -Wno-unused -m68060
    4343;
    4444
    4545
    46 KernelMergeObject boot_platform_atari_m68k_other.o :
     46BootMergeObject boot_platform_atari_m68k_other.o :
    4747#   shell.S
    4848    start.cpp
    4949    toscalls.cpp
     
    7373    : -fno-pic #-Wa,--pcrel
    7474;
    7575
    76 KernelMergeObject boot_platform_atari_m68k.o :
     76BootMergeObject boot_platform_atari_m68k.o :
    7777    : :
    7878    boot_platform_atari_m68k_shell.o
    7979    boot_platform_atari_m68k_other.o
  • src/system/boot/platform/u-boot/Jamfile

     
    3434    video_rle.cpp
    3535;
    3636
    37 KernelMergeObject boot_platform_u-boot.o :
     37BootMergeObject boot_platform_u-boot.o :
    3838    shell.S
    3939    start2.cpp
    4040    debug.cpp
  • src/system/boot/platform/bios_ia32/Jamfile

     
    11SubDir HAIKU_TOP src system boot platform bios_ia32 ;
    22
     3DEFINES += _BOOT_MODE ;
     4
    35SubDirHdrs $(HAIKU_TOP) headers private kernel boot platform $(TARGET_BOOT_PLATFORM) ;
    46
    57UsePrivateHeaders [ FDirName kernel disk_device_manager ] ;
     
    2426    video_rle.cpp
    2527;
    2628
    27 KernelMergeObject boot_platform_bios_ia32.o :
     29BootMergeObject boot_platform_bios_ia32.o :
    2830    shell.S
    2931    start.cpp
    3032    debug.cpp
     
    4446    video.cpp
    4547    apm.cpp
    4648    hpet.cpp
     49    long.cpp
    4750
    4851    $(genericPlatformSources)
    4952
  • src/system/boot/platform/pxe_ia32/Jamfile

     
    4949;
    5050
    5151
    52 KernelMergeObject boot_platform_pxe_ia32.o :
     52BootMergeObject boot_platform_pxe_ia32.o :
    5353    pxe_stage2.S
    5454    smp_trampoline.S
    5555    pxe_bios.S
  • src/system/boot/platform/openfirmware/Jamfile

     
    22
    33SubDirC++Flags -D_BOOT_MODE -fno-rtti ;
    44
    5 KernelMergeObject boot_platform_openfirmware.o :
     5BootMergeObject boot_platform_openfirmware.o :
    66    console.cpp
    77    debug.cpp
    88    devices.cpp
  • src/system/boot/platform/openfirmware/arch/ppc/Jamfile

     
    77
    88SubDirC++Flags -fno-rtti ;
    99
    10 KernelStaticLibrary boot_platform_openfirmware_ppc :
     10BootStaticLibrary boot_platform_openfirmware_ppc :
    1111    arch_mmu.cpp
    1212    arch_cpu_asm.S
    1313    arch_start_kernel.S
  • src/system/boot/loader/net/Jamfile

     
    44
    55SubDirC++Flags -fno-rtti ;
    66
    7 KernelStaticLibrary boot_net :
     7BootStaticLibrary boot_net :
    88    ARP.cpp
    99    ChainBuffer.cpp
    1010    Ethernet.cpp
  • src/system/boot/loader/file_systems/tarfs/Jamfile

     
    11SubDir HAIKU_TOP src system boot loader file_systems tarfs ;
    22
     3DEFINES += _BOOT_MODE ;
     4
    35UseHeaders [ FDirName $(HAIKU_TOP) headers libs zlib ] ;
    46
    57UsePrivateHeaders [ FDirName kernel boot platform $(TARGET_BOOT_PLATFORM) ] ;
     
    1416SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src libs zlib ] ;
    1517
    1618
    17 KernelStaticLibrary boot_zlib :
     19BootStaticLibrary boot_zlib :
    1820    inflate.c
    1921    inffast.c
    2022    inftrees.c
     
    2527    ;
    2628
    2729
    28 KernelStaticLibrary boot_tarfs :
     30BootStaticLibrary boot_tarfs :
    2931    tarfs.cpp
    3032    : -fno-pic
    3133    ;
  • src/system/boot/loader/file_systems/hfs_plus/Jamfile

     
    11SubDir HAIKU_TOP src system boot loader file_systems hfs_plus ;
    22
     3DEFINES += _BOOT_MODE ;
     4
    35UsePrivateHeaders [ FDirName kernel boot platform $(TARGET_BOOT_PLATFORM) ] ;
    46UsePrivateHeaders [ FDirName kernel disk_device_manager ] ;
    57UsePrivateHeaders kernel storage ;
    68
     9local defines = [ FDefines _BOOT_MODE ] ;
    710SubDirC++Flags -fno-rtti ;
    811
    9 KernelStaticLibrary boot_hfs_plus :
     12BootStaticLibrary boot_hfs_plus :
    1013    hfs_plus.cpp
    1114    : -fno-pic
    1215    ;
  • src/system/boot/loader/file_systems/bfs/Jamfile

     
    11SubDir HAIKU_TOP src system boot loader file_systems bfs ;
    22
     3DEFINES += _BOOT_MODE ;
     4
    35UsePrivateKernelHeaders ;
    46UsePrivateHeaders shared storage ;
    57
     
    1012SubDirCcFlags $(defines) ;
    1113SubDirC++Flags -fno-rtti $(defines) ;
    1214
    13 KernelStaticLibrary boot_bfs :
     15BootStaticLibrary boot_bfs :
    1416    bfs.cpp
    1517    Directory.cpp
    1618    File.cpp
  • src/system/boot/loader/file_systems/fat/Jamfile

     
    11SubDir HAIKU_TOP src system boot loader file_systems fat ;
    22
     3DEFINES += _BOOT_MODE ;
     4
    35#UsePrivateHeaders [ FDirName kernel boot platform $(TARGET_BOOT_PLATFORM) ] ;
    46#UsePrivateHeaders [ FDirName kernel disk_device_manager ] ;
    57#UsePrivateHeaders [ FDirName storage ] ;
     
    1315SubDirCcFlags $(defines) ;
    1416SubDirC++Flags -fno-rtti $(defines) ;
    1517
    16 KernelStaticLibrary boot_fatfs :
     18BootStaticLibrary boot_fatfs :
    1719    fatfs.cpp
    1820    Volume.cpp
    1921    CachedBlock.cpp
  • src/system/boot/loader/file_systems/amiga_ffs/Jamfile

     
    66
    77#SubDirHdrs $(HAIKU_TOP) src add-ons kernel file_systems amiga_ffs ;
    88
     9DEFINES += _BOOT_MODE ;
     10
    911SubDirC++Flags -fno-rtti ;
    1012
    11 KernelStaticLibrary boot_amiga_ffs :
     13BootStaticLibrary boot_amiga_ffs :
    1214    amiga_ffs.cpp
    1315    Volume.cpp
    1416    Directory.cpp
  • src/system/boot/loader/Jamfile

     
    11SubDir HAIKU_TOP src system boot loader ;
    22
     3DEFINES += _BOOT_MODE ;
     4
    35SubDirHdrs $(HAIKU_TOP) src add-ons kernel partitioning_systems amiga ;
    46SubDirHdrs $(HAIKU_TOP) src add-ons kernel partitioning_systems apple ;
    57SubDirHdrs $(HAIKU_TOP) src add-ons kernel partitioning_systems efi ;
     
    4345                #BOOT_SUPPORT_FILE_SYSTEM_FAT
    4446            ;
    4547        }
     48        case "x86_64" :
     49        {
     50            defines +=
     51                BOOT_SUPPORT_PARTITION_EFI
     52
     53                #BOOT_SUPPORT_FILE_SYSTEM_FAT
     54            ;
     55        }
    4656    }
    4757
    4858    defines = [ FDefines $(defines) ] ;
     
    5060    SubDirC++Flags $(defines) -Wall -Wno-multichar -fno-rtti ;
    5161}
    5262
    53 KernelStaticLibrary boot_loader :
     63BootStaticLibrary boot_loader :
    5464    elf.cpp
    5565    heap.cpp
    5666    kernel_args.cpp
     
    8191# The partition support is built in an extra static library
    8292# so that only the ones that are used will be included.
    8393
    84 KernelStaticLibrary boot_partitions :
     94BootStaticLibrary boot_partitions :
    8595    FileMapDisk.cpp
    8696    amiga_rdb.cpp
    8797    apple.cpp
  • src/system/boot/Jamfile

     
    11SubDir HAIKU_TOP src system boot ;
    22
    3 local librootFunctions =
    4     abs.o
    5     ctype.o
    6     LocaleData.o
    7     qsort.o
    8     kernel_vsprintf.o
    9     memcmp.o
    10     memmove.o
    11     strdup.o
    12     strlen.o
    13     strnlen.o
    14     strcmp.o
    15     strcasecmp.o
    16     strncmp.o
    17     strcat.o
    18     strcpy.o
    19     strlcat.o
    20     strlcpy.o
    21     strchr.o
    22     strrchr.o
    23     strtol.o
     3DEFINES += _BOOT_MODE ;
     4
     5SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) libroot posix string ] ;
     6SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) libroot posix stdlib ] ;
     7SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) libroot posix locale ] ;
     8SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) kernel lib ] ;
     9
     10BootMergeObject boot_librootFunctions.o :
     11    abs.c
     12    ctype.cpp
     13    LocaleData.cpp
     14    qsort.c
     15    kernel_vsprintf.cpp
     16    memcmp.c
     17    memmove.c
     18    strdup.c
     19    strlen.c
     20    strnlen.c
     21    strcmp.c
     22    strcasecmp.c
     23    strncmp.c
     24    strcat.c
     25    strcpy.c
     26    strlcat.c
     27    strlcpy.c
     28    strchr.c
     29    strrchr.c
     30    strtol.c
     31    : -fno-pic
    2432;
    2533
    2634local extraLinkerArgs = ;
     
    3038
    3139AddResources haiku_loader : boot_loader.rdef ;
    3240
    33 KernelLd boot_loader_$(TARGET_BOOT_PLATFORM) :
     41BootLd boot_loader_$(TARGET_BOOT_PLATFORM) :
    3442    boot_platform_$(TARGET_BOOT_PLATFORM).o
    3543    boot_arch_$(TARGET_ARCH).o
    3644    boot_loader.a
     
    4856
    4957    # libroot functions needed by the stage2 boot loader (compiled for the
    5058    # kernel)
    51     $(librootFunctions:G=src!system!kernel!lib)
     59    boot_librootFunctions.o
    5260
    5361    : $(HAIKU_TOP)/src/system/ldscripts/$(TARGET_ARCH)/boot_loader_$(TARGET_BOOT_PLATFORM).ld
    5462    : -Bstatic $(extraLinkerArgs)
    5563;
    5664
     65
     66
    5767rule BuildCoffLoader {
    5868    local coffLoader = $(1) ;
    5969    local bootLoader = $(2) ;
  • src/system/boot/arch/arm/Jamfile

     
    1515    <src!system!kernel!lib!arch!$(TARGET_ARCH)>memset.o
    1616;
    1717
    18 KernelMergeObject boot_arch_$(TARGET_ARCH).o :
     18BootMergeObject boot_arch_$(TARGET_ARCH).o :
    1919    uart.cpp
    2020    arch_elf.cpp
    2121    arch_video.cpp
  • src/system/boot/arch/ppc/Jamfile

     
    88    <src!system!kernel!lib!arch!$(TARGET_ARCH)>memset.o
    99;
    1010
    11 KernelMergeObject boot_arch_$(TARGET_ARCH).o :
     11BootMergeObject boot_arch_$(TARGET_ARCH).o :
    1212    arch_elf.cpp
    1313    : # additional flags
    1414    :
  • src/system/boot/arch/m68k/Jamfile

     
    1313    <src!system!kernel!lib!arch!$(TARGET_ARCH)>memset.o
    1414;
    1515
    16 KernelMergeObject boot_arch_$(TARGET_ARCH).o :
     16BootMergeObject boot_arch_$(TARGET_ARCH).o :
    1717    arch_elf.cpp
    1818    $(librootArchObjects)
    1919    : -fno-pic
  • src/system/boot/arch/x86/Jamfile

     
    1818    <src!system!kernel!lib!arch!$(TARGET_ARCH)>byteorder.o
    1919;
    2020
    21 KernelMergeObject boot_arch_$(TARGET_ARCH).o :
     21BootMergeObject boot_arch_$(TARGET_ARCH).o :
    2222    $(kernelArchSources)
    2323    $(kernelLibArchSources)
    2424    : # additional flags
  • src/system/boot/arch/mipsel/Jamfile

     
    88    <src!system!kernel!lib!arch!$(TARGET_ARCH)>memset.o
    99;
    1010
    11 KernelMergeObject boot_arch_$(TARGET_ARCH).o :
     11BootMergeObject boot_arch_$(TARGET_ARCH).o :
    1212    arch_elf.cpp
    1313    : # additional flags
    1414    :
  • src/system/boot/arch/x86_64/Jamfile

     
     1SubDir HAIKU_TOP src system boot arch x86_64 ;
     2
     3DEFINES += _BOOT_MODE ;
     4
     5local kernelArchSources =
     6    arch_elf.cpp
     7    cpuid.S
     8;
     9
     10local kernelLibArchSources =
     11    arch_string.S
     12;
     13
     14local librootosArchObjects =
     15    byteorder.S
     16;
     17
     18BootMergeObject boot_arch_$(TARGET_ARCH).o :
     19    $(kernelArchSourcesCPP)
     20    $(kernelArchSources)
     21    $(kernelLibArchSources)
     22    $(librootosArchObjects)
     23    : # additional flags
     24;
     25
     26SEARCH on [ FGristFiles $(kernelArchSources) ]
     27    = [ FDirName $(HAIKU_TOP) src system kernel arch x86 ] ;
     28SEARCH on [ FGristFiles $(kernelLibArchSources) ]
     29    = [ FDirName $(HAIKU_TOP) src system kernel lib arch x86 ] ;
     30SEARCH on [ FGristFiles $(librootosArchObjects) ]
     31    = [ FDirName $(HAIKU_TOP) src system libroot os arch x86 ] ;
     32
  • src/system/glue/arch/x86_64/Jamfile

     
     1SubDir HAIKU_TOP src system glue arch x86_64 ;
     2
     3KernelObjects
     4    crti.S
     5    crtn.S
     6    ;
     7
  • headers/build/config_build/HaikuConfig.h

     
    1717   __HAIKU_BIG_ENDIAN           - defined to 1 on big endian architectures
    1818                                  (defaults to undefined)
    1919*/
    20 #ifdef __INTEL__
    21 #   define __HAIKU_ARCH             x86
    22 #   define __HAIKU_ARCH_X86         1
    23 #elif __x86_64__
     20#ifdef __x86_64__
    2421#   define __HAIKU_ARCH             x86_64
    2522#   define __HAIKU_ARCH_X86_64      1
    2623#   define __HAIKU_ARCH_BITS        64
     24#elif __INTEL__
     25#   define __HAIKU_ARCH             x86
     26#   define __HAIKU_ARCH_X86         1
    2727#elif __POWERPC__
    2828#   define __HAIKU_ARCH             ppc
    2929#   define __HAIKU_ARCH_PPC         1
  • headers/os/kernel/OS.h

     
    410410
    411411/* System information */
    412412
    413 #if __INTEL__
     413#if   __x86_64__
     414#   define B_MAX_CPU_COUNT  1
     415#elif __INTEL__
    414416#   define B_MAX_CPU_COUNT  8
    415417#elif __POWERPC__
    416418#   define B_MAX_CPU_COUNT  8
  • headers/config/HaikuConfig.h

     
    1717   __HAIKU_BIG_ENDIAN           - defined to 1 on big endian architectures
    1818                                  (defaults to undefined)
    1919*/
    20 #ifdef __INTEL__
     20#ifdef __x86_64__
     21#   define __HAIKU_ARCH                 x86_64
     22#   define __HAIKU_ARCH_X86_64          1
     23#   define __HAIKU_ARCH_BITS            64
     24#elif __INTEL__
    2125#   define __HAIKU_ARCH                 x86
    2226#   define __HAIKU_ARCH_X86             1
    2327#   define __HAIKU_ARCH_PHYSICAL_BITS   64
    24 #elif __x86_64__
    25 #   define __HAIKU_ARCH                 x86_64
    26 #   define __HAIKU_ARCH_X86_64          1
    27 #   define __HAIKU_ARCH_BITS            64
    2828#elif __POWERPC__
    2929#   define __HAIKU_ARCH                 ppc
    3030#   define __HAIKU_ARCH_PPC             1
  • src/system/ldscripts/x86_64/add-on.ld

     
     1OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
     2OUTPUT_ARCH(i386:x86-64)
     3
     4ENTRY(_start)
     5SEARCH_DIR("libgcc");
     6SECTIONS
     7{
     8    . = 0x00000000 + SIZEOF_HEADERS;
     9
     10    .interp : { *(.interp) }
     11    .hash : { *(.hash) }
     12    .dynsym : { *(.dynsym) }
     13    .dynstr : { *(.dynstr) }
     14    .rel.text : { *(.rel.text) *(.rel.gnu.linkonce.t*) }
     15    .rela.text : { *(.rela.text) *(.rela.gnu.linkonce.t*) }
     16    .rel.data : { *(.rel.data) *(.rel.gnu.linkonce.d*) }
     17    .rela.data : { *(.rela.data) *(.rela.gnu.linkonce.d*) }
     18    .rel.rodata : { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
     19    .rela.rodata : { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
     20    .rel.got : { *(.rel.got) }
     21    .rela.got : { *(.rela.got) }
     22    .rel.ctors : { *(.rel.ctors) }
     23    .rela.ctors : { *(.rela.ctors) }
     24    .rel.dtors : { *(.rel.dtors) }
     25    .rela.dtors : { *(.rela.dtors) }
     26    .rel.init : { *(.rel.init) }
     27    .rela.init : { *(.rela.init) }
     28    .rel.fini : { *(.rel.fini) }
     29    .rela.fini : { *(.rela.fini) }
     30    .rel.bss : { *(.rel.bss) }
     31    .rela.bss : { *(.rela.bss) }
     32    .rel.plt : { *(.rel.plt) }
     33    .rela.plt : { *(.rela.plt) }
     34    .init : { *(.init) } =0x9090
     35    .plt : { *(.plt) }
     36
     37    /* text/read-only data */
     38    .text : { *(.text .gnu.linkonce.t.*) } =0x9090
     39
     40    .rodata : { *(.rodata) }
     41
     42    /* writable data  */
     43    . = ALIGN(0x1000) + (. & (0x1000 - 1));
     44    __data_start = .;
     45    .data : { *(.data .gnu.linkonce.d.*) }
     46
     47    . = ALIGN(0x4);
     48    __ctor_list = .;
     49    .ctors : { *(.ctors) }
     50    __ctor_end = .;
     51    __dtor_list = .;
     52    .dtors : { *(.dtors) }
     53    __dtor_end = .;
     54    .got : { *(.got.plt) *(.got) }
     55    .dynamic : { *(.dynamic) }
     56   
     57    /* uninitialized data (in same segment as writable data) */
     58    __bss_start = .;
     59    .bss : { *(.bss) }
     60
     61    . = ALIGN(0x1000);
     62    _end = . ;
     63
     64    /* Strip unnecessary stuff */
     65    /DISCARD/ : { *(.comment .note .eh_frame) }
     66}
  • src/system/ldscripts/x86_64/boot_loader_bios_ia32.ld

     
     1OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
     2OUTPUT_ARCH(i386)
     3
     4ENTRY(_start)
     5SECTIONS
     6{
     7    . = 0x10000;
     8
     9    /* text/read-only data */
     10    .text : { *(.text .gnu.linkonce.t.*) }
     11
     12    . = ALIGN(0x4);
     13    __ctor_list = .;
     14    .ctors : { *(.ctors) }
     15    __ctor_end = .;
     16
     17    .rodata : { *(.rodata .rodata.*) }
     18
     19    /* writable data  */
     20    . = ALIGN(0x1000);
     21    __data_start = .;
     22    .data : { *(.data .gnu.linkonce.d.*) }
     23
     24    /* uninitialized data (in same segment as writable data) */
     25    __bss_start = .;
     26    .bss : { *(.bss) }
     27
     28    . = ALIGN(0x1000);
     29    _end = . ;
     30
     31    /* Strip unnecessary stuff */
     32    /DISCARD/ : { *(.comment .note .eh_frame .dtors .stab .stabstr .debug*) }
     33}
  • src/system/ldscripts/x86_64/library.ld

     
     1OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
     2OUTPUT_ARCH(i386:x86-64)
     3
     4ENTRY(_start)
     5SEARCH_DIR("libgcc");
     6SECTIONS
     7{
     8    . = 0x00200000 + SIZEOF_HEADERS;
     9
     10    .interp : { *(.interp) }
     11    .hash : { *(.hash) }
     12    .dynsym : { *(.dynsym) }
     13    .dynstr : { *(.dynstr) }
     14    .rel.text : { *(.rel.text) *(.rel.gnu.linkonce.t*) }
     15    .rela.text : { *(.rela.text) *(.rela.gnu.linkonce.t*) }
     16    .rel.data : { *(.rel.data) *(.rel.gnu.linkonce.d*) }
     17    .rela.data : { *(.rela.data) *(.rela.gnu.linkonce.d*) }
     18    .rel.rodata : { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
     19    .rela.rodata : { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
     20    .rel.got : { *(.rel.got) }
     21    .rela.got : { *(.rela.got) }
     22    .rel.ctors : { *(.rel.ctors) }
     23    .rela.ctors : { *(.rela.ctors) }
     24    .rel.dtors : { *(.rel.dtors) }
     25    .rela.dtors : { *(.rela.dtors) }
     26    .rel.init : { *(.rel.init) }
     27    .rela.init : { *(.rela.init) }
     28    .rel.fini : { *(.rel.fini) }
     29    .rela.fini : { *(.rela.fini) }
     30    .rel.bss : { *(.rel.bss) }
     31    .rela.bss : { *(.rela.bss) }
     32    .rel.plt : { *(.rel.plt) }
     33    .rela.plt : { *(.rela.plt) }
     34    .init : { *(.init) } =0x9090
     35    .fini : { *(.fini) } =0x9090
     36    .plt : { *(.plt) }
     37
     38    /* text/read-only data */
     39    .text : { *(.text .gnu.linkonce.t.*) }
     40
     41    .rodata : { *(.rodata) }
     42
     43    /* writable data  */
     44    . = ALIGN(0x1000) + (. & (0x1000 - 1));
     45    __data_start = .;
     46    PROVIDE(_data_start = .);
     47    .data : { *(.data .gnu.linkonce.d.*) }
     48
     49    __ctor_list = .;
     50    PROVIDE (_ctor_list = .);
     51    .ctors : { *(.ctors) }
     52    __ctor_end = .;
     53    PROVIDE (_ctor_end = .);
     54
     55    __dtor_list = .;
     56    PROVIDE (_dtor_list = .);
     57    .dtors : { *(.dtors) }
     58    __dtor_end = .;
     59    PROVIDE (_dtor_end = .);
     60
     61    .got     : { *(.got.plt) *(.got) }
     62    .dynamic : { *(.dynamic) }
     63
     64
     65    /* uninitialized data (in same segment as writable data) */
     66    PROVIDE (__bss_start = .);
     67    .bss : { *(.bss) }
     68
     69    . = ALIGN(0x1000);
     70    PROVIDE (_end = .);
     71
     72    /* Strip unnecessary stuff */
     73    /DISCARD/ : { *(.comment .note) }
     74}
  • src/system/ldscripts/x86_64/runtime_loader.ld

     
     1OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
     2OUTPUT_ARCH(i386:x86-64)
     3
     4ENTRY(runtime_loader)
     5SEARCH_DIR("libgcc");
     6SECTIONS
     7{
     8    . = 0x00100000 + SIZEOF_HEADERS;
     9
     10    .interp : { *(.interp) }
     11    .hash : { *(.hash) }
     12    .dynsym : { *(.dynsym) }
     13    .dynstr : { *(.dynstr) }
     14    .rel.text : { *(.rel.text) *(.rel.gnu.linkonce.t*) }
     15    .rela.text : { *(.rela.text) *(.rela.gnu.linkonce.t*) }
     16    .rel.data : { *(.rel.data) *(.rel.gnu.linkonce.d*) }
     17    .rela.data : { *(.rela.data) *(.rela.gnu.linkonce.d*) }
     18    .rel.rodata : { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
     19    .rela.rodata : { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
     20    .rel.got : { *(.rel.got) }
     21    .rela.got : { *(.rela.got) }
     22    .rel.ctors : { *(.rel.ctors) }
     23    .rela.ctors : { *(.rela.ctors) }
     24    .rel.dtors : { *(.rel.dtors) }
     25    .rela.dtors : { *(.rela.dtors) }
     26    .rel.init : { *(.rel.init) }
     27    .rela.init : { *(.rela.init) }
     28    .rel.fini : { *(.rel.fini) }
     29    .rela.fini : { *(.rela.fini) }
     30    .rel.bss : { *(.rel.bss) }
     31    .rela.bss : { *(.rela.bss) }
     32    .rel.plt : { *(.rel.plt) }
     33    .rela.plt : { *(.rela.plt) }
     34    .init : { *(.init) } =0x9090
     35    .plt : { *(.plt) }
     36
     37    /* text/read-only data */
     38    .text : { *(.text .gnu.linkonce.t.*) }
     39
     40    .rodata : { *(.rodata) }
     41
     42    /* writable data  */
     43    . = ALIGN(0x1000) + (. & (0x1000 - 1));
     44    __data_start = .;
     45    PROVIDE(_data_start = .);
     46    .data : { *(.data .gnu.linkonce.d.*) }
     47
     48    __ctor_list = .;
     49    PROVIDE (_ctor_list = .);
     50    .ctors : { *(.ctors) }
     51    PROVIDE (__ctor_end = .);
     52
     53
     54    /* uninitialized data (in same segment as writable data) */
     55    PROVIDE (__bss_start = .);
     56    .bss : { *(.bss) }
     57
     58    . = ALIGN(0x1000);
     59    PROVIDE (_end = .);
     60
     61    /* Strip unnecessary stuff */
     62    /DISCARD/ : { *(.comment .note .eh_frame .dtors) }
     63}
  • src/system/ldscripts/x86_64/kernel.ld

     
     1OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
     2OUTPUT_ARCH(i386:x86-64)
     3
     4ENTRY(init_long_mode)
     5SEARCH_DIR("libgcc");
     6SECTIONS
     7{
     8    . = 0x80000000 + SIZEOF_HEADERS;
     9
     10    .interp : { *(.interp) }
     11    .hash : { *(.hash) }
     12    .dynsym : { *(.dynsym) }
     13    .dynstr : { *(.dynstr) }
     14    .rel.text : { *(.rel.text) *(.rel.gnu.linkonce.t*) }
     15    .rela.text : { *(.rela.text) *(.rela.gnu.linkonce.t*) }
     16    .rel.data : { *(.rel.data) *(.rel.gnu.linkonce.d*) }
     17    .rela.data : { *(.rela.data) *(.rela.gnu.linkonce.d*) }
     18    .rel.rodata : { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
     19    .rela.rodata : { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
     20    .rel.got : { *(.rel.got) }
     21    .rela.got : { *(.rela.got) }
     22    .rel.ctors : { *(.rel.ctors) }
     23    .rela.ctors : { *(.rela.ctors) }
     24    .rel.dtors : { *(.rel.dtors) }
     25    .rela.dtors : { *(.rela.dtors) }
     26    .rel.init : { *(.rel.init) }
     27    .rela.init : { *(.rela.init) }
     28    .rel.fini : { *(.rel.fini) }
     29    .rela.fini : { *(.rela.fini) }
     30    .rel.bss : { *(.rel.bss) }
     31    .rela.bss : { *(.rela.bss) }
     32    .rel.plt : { *(.rel.plt) }
     33    .rela.plt : { *(.rela.plt) }
     34    .init : { *(.init) } =0x9090
     35    .plt : { *(.plt) }
     36
     37    /* text/read-only data */
     38    .text : { *(.text .gnu.linkonce.t.*) } =0x9090
     39
     40    .rodata : { *(.rodata) }
     41
     42    /* writable data  */
     43    . = ALIGN(0x1000);
     44    __data_start = .;
     45    .data : { *(.data .gnu.linkonce.d.*) }
     46
     47    . = ALIGN(0x4);
     48    __ctor_list = .;
     49    .ctors : { *(.ctors) }
     50    __ctor_end = .;
     51    __dtor_list = .;
     52    .dtors : { *(.dtors) }
     53    __dtor_end = .;
     54    .got : { *(.got.plt) *(.got) }
     55    .dynamic : { *(.dynamic) }
     56   
     57    /* uninitialized data (in same segment as writable data) */
     58    __bss_start = .;
     59    .bss : { *(.bss) }
     60
     61    . = ALIGN(0x1000);
     62    _end = . ;
     63
     64    /* Strip unnecessary stuff */
     65    /DISCARD/ : { *(.comment .note .eh_frame) }
     66}
  • src/system/ldscripts/x86_64/app.ld

     
     1OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
     2OUTPUT_ARCH(i386:x86-64)
     3
     4ENTRY(_start)
     5SEARCH_DIR("libgcc");
     6SECTIONS
     7{
     8    . = 0x00200000 + SIZEOF_HEADERS;
     9
     10    .interp : { *(.interp) }
     11    .hash : { *(.hash) }
     12    .dynsym : { *(.dynsym) }
     13    .dynstr : { *(.dynstr) }
     14    .rel.text : { *(.rel.text) *(.rel.gnu.linkonce.t*) }
     15    .rela.text : { *(.rela.text) *(.rela.gnu.linkonce.t*) }
     16    .rel.data : { *(.rel.data) *(.rel.gnu.linkonce.d*) }
     17    .rela.data : { *(.rela.data) *(.rela.gnu.linkonce.d*) }
     18    .rel.rodata : { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
     19    .rela.rodata : { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
     20    .rel.got : { *(.rel.got) }
     21    .rela.got : { *(.rela.got) }
     22    .rel.ctors : { *(.rel.ctors) }
     23    .rela.ctors : { *(.rela.ctors) }
     24    .rel.dtors : { *(.rel.dtors) }
     25    .rela.dtors : { *(.rela.dtors) }
     26    .rel.init : { *(.rel.init) }
     27    .rela.init : { *(.rela.init) }
     28    .rel.fini : { *(.rel.fini) }
     29    .rela.fini : { *(.rela.fini) }
     30    .rel.bss : { *(.rel.bss) }
     31    .rela.bss : { *(.rela.bss) }
     32    .rel.plt : { *(.rel.plt) }
     33    .rela.plt : { *(.rela.plt) }
     34    .init : { *(.init) } =0x9090
     35    .fini : { *(.fini) } =0x9090
     36    .plt : { *(.plt) }
     37
     38    /* text/read-only data */
     39    .text : { *(.text .gnu.linkonce.t.*) }
     40    .rodata : { *(.rodata) }
     41
     42    /* writable data  */
     43    . = ALIGN(0x1000) + (. & (0x1000 - 1));
     44    __data_start = .;
     45    PROVIDE(_data_start = .);
     46    .data : { *(.data .gnu.linkonce.d.*) }
     47
     48    __ctor_list = .;
     49    PROVIDE (_ctor_list = .);
     50    .ctors : { *(.ctors) }
     51    __ctor_end = .;
     52    PROVIDE (_ctor_end = .);
     53
     54    __dtor_list = .;
     55    PROVIDE (_dtor_list = .);
     56    .dtors : { *(.dtors) }
     57    __dtor_end = .;
     58    PROVIDE (_dtor_end = .);
     59
     60    .got     : { *(.got.plt) *(.got) }
     61    .dynamic : { *(.dynamic) }
     62
     63    /* uninitialized data (in same segment as writable data) */
     64    PROVIDE (__bss_start = .);
     65    .bss : { *(.bss) }
     66
     67    . = ALIGN(0x1000);
     68    PROVIDE (_end = .);
     69
     70    /* Strip unnecessary stuff */
     71    /DISCARD/ : { *(.comment .note) }
     72}