Ticket #8279: 0001-Workarounds-for-gcc-4.6.2.patch

File 0001-Workarounds-for-gcc-4.6.2.patch, 5.7 KB (added by korli, 12 years ago)

Workarounds for gcc 4.6.2

  • build/jam/BuildSetup

    From fb35ed78c037a7531472af9bb6144836b0a8a5b6 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= <jerome.duval@gmail.com>
    Date: Sun, 8 Jan 2012 00:03:57 +0100
    Subject: [PATCH] Workarounds for gcc 4.6.2
    
    * add -Wno-unused-but-set-variable for gcc 4.6.x with a TODO
    * signal.cpp, sem.cpp, team.cpp, arch/x86/arch_debug.cpp need to be compiled with -O0
    * fix warnings about wrong size of pointer cast in ioapic.cpp and AudioBuffer.cpp
    ---
     build/jam/BuildSetup                          |   28 ++++++++++++------------
     src/apps/cortex/addons/common/AudioBuffer.cpp |    4 +-
     src/system/kernel/Jamfile                     |   18 ++++++++++++---
     src/system/kernel/arch/x86/Jamfile            |    9 +++++++-
     src/system/kernel/arch/x86/ioapic.cpp         |    4 +-
     5 files changed, 40 insertions(+), 23 deletions(-)
    
    diff --git a/build/jam/BuildSetup b/build/jam/BuildSetup
    index c46977e..22ef3cd 100644
    a b AUTO_SET_UP_CONFIG_VARIABLES +=  
    11851185
    11861186
    11871187# enable -Werror for certain parts of the source tree
    1188 
    1189 if $(HAIKU_GCC_VERSION[1]) = 2 {
    1190     rule EnableWerror dirTokens : scope {
    1191         AppendToConfigVar CCFLAGS : HAIKU_TOP $(dirTokens) : -Werror
    1192             : $(scope) ;
    1193         AppendToConfigVar C++FLAGS : HAIKU_TOP $(dirTokens) : -Werror
    1194             : $(scope) ;
    1195     }
    1196 } else {
     1188WERRORFLAGS = ;
     1189if $(HAIKU_GCC_VERSION[1]) >= 4 {
    11971190    # -Wuninitialized gives too many false positives.
    1198     rule EnableWerror dirTokens : scope {
    1199         AppendToConfigVar CCFLAGS : HAIKU_TOP $(dirTokens)
    1200             : -Werror -Wno-error=uninitialized : $(scope) ;
    1201         AppendToConfigVar C++FLAGS : HAIKU_TOP $(dirTokens)
    1202             : -Werror -Wno-error=uninitialized : $(scope) ;
     1191    WERRORFLAGS = -Wno-error=uninitialized ;
     1192
     1193    if $(HAIKU_GCC_VERSION[2]) >= 6 {
     1194        # TODO: remove the -Wno-unused-but-set-variable option
     1195        WERRORFLAGS = -Wno-error=uninitialized -Wno-unused-but-set-variable ;
    12031196    }
    12041197}
    12051198
     1199rule EnableWerror dirTokens : scope {
     1200    AppendToConfigVar CCFLAGS : HAIKU_TOP $(dirTokens) : -Werror $(WERRORFLAGS)
     1201        : $(scope) ;
     1202    AppendToConfigVar C++FLAGS : HAIKU_TOP $(dirTokens) : -Werror $(WERRORFLAGS)
     1203        : $(scope) ;
     1204}
     1205
    12061206# Work-around for GCC 2 problem -- despite -Wno-multichar it reports
    12071207# multichar warnings in headers/private/kernel/debugger_keymaps.h included by
    12081208# src/system/kernel/arch/x86/arch_debug_console.cpp.
  • src/apps/cortex/addons/common/AudioBuffer.cpp

    diff --git a/src/apps/cortex/addons/common/AudioBuffer.cpp b/src/apps/cortex/addons/common/AudioBuffer.cpp
    index 47613bb..f092127 100644
    a b uint32 AudioBuffer::copyTo(  
    223223    // convert and copy a sample at a time
    224224    for(; remaining; remaining -= sampleSize) {
    225225        convert_sample(
    226             (void*) *((int8*)m_pData + fromOffset),
    227             (void*) *((int8*)target.m_pData + targetOffset),
     226            (void*) ((int8*)m_pData + fromOffset),
     227            (void*) ((int8*)target.m_pData + targetOffset),
    228228            m_format.format,
    229229            target.m_format.format);
    230230       
  • src/system/kernel/Jamfile

    diff --git a/src/system/kernel/Jamfile b/src/system/kernel/Jamfile
    index 04b3719..2467d81 100644
    a b KernelMergeObject kernel_core.o :  
    4545    real_time_clock.cpp
    4646    sem.cpp
    4747    shutdown.cpp
    48     signal.cpp
    49     system_info.cpp
    50     smp.cpp
    5148    syscalls.cpp
    52     team.cpp
     49    system_info.cpp
    5350    thread.cpp
    5451    timer.cpp
    5552    UserEvent.cpp
    KernelMergeObject kernel_core.o :  
    6865    scheduler_simple_smp.cpp
    6966    scheduler_tracing.cpp
    7067    scheduling_analysis.cpp
     68    : $(TARGET_KERNEL_PIC_CCFLAGS)
     69;
     70
     71OPTIM = -O0 ;
    7172
     73KernelMergeObject kernel_core0.o :
     74    signal.cpp
     75    smp.cpp
     76    team.cpp
     77   
    7278    : $(TARGET_KERNEL_PIC_CCFLAGS)
    7379;
    7480
    KernelLd linkhack.so :  
    103109
    104110KernelLd kernel_$(TARGET_ARCH) :
    105111    kernel_cache.o
     112    kernel_core0.o
    106113    kernel_core.o
    107114    kernel_debug.o
    108115    kernel_device_manager.o
    KernelLd kernel_$(TARGET_ARCH) :  
    115122    kernel_vm.o
    116123
    117124    kernel_arch_$(TARGET_ARCH).o
     125    kernel_arch_$(TARGET_ARCH)0.o
    118126    kernel_platform_$(TARGET_BOOT_PLATFORM).o
    119127
    120128    linkhack.so
    KernelLd kernel_$(TARGET_ARCH) :  
    137145KernelLd kernel.so :
    138146    kernel_cache.o
    139147    kernel_core.o
     148    kernel_core0.o
    140149    kernel_debug.o
    141150    kernel_device_manager.o
    142151    kernel_disk_device_manager.o
    KernelLd kernel.so :  
    148157    kernel_vm.o
    149158
    150159    kernel_arch_$(TARGET_ARCH).o
     160    kernel_arch_$(TARGET_ARCH)0.o
    151161    kernel_platform_$(TARGET_BOOT_PLATFORM).o
    152162
    153163    linkhack.so
  • src/system/kernel/arch/x86/Jamfile

    diff --git a/src/system/kernel/arch/x86/Jamfile b/src/system/kernel/arch/x86/Jamfile
    index ecb9706..3864e19 100644
    a b SEARCH_SOURCE += [ FDirName $(SUBDIR) timers ] ;  
    1919KernelMergeObject kernel_arch_x86.o :
    2020    arch_commpage.cpp
    2121    arch_cpu.cpp
    22     arch_debug.cpp
    2322    arch_debug_console.cpp
    2423    arch_elf.cpp
    2524    arch_int.cpp
    KernelMergeObject kernel_arch_x86.o :  
    7473    $(TARGET_KERNEL_PIC_CCFLAGS)
    7574;
    7675
     76OPTIM = -O0 ;
     77
     78KernelMergeObject kernel_arch_x860.o :
     79    arch_debug.cpp
     80    :
     81    $(TARGET_KERNEL_PIC_CCFLAGS)
     82;
     83
    7784CreateAsmStructOffsetsHeader asm_offsets.h : asm_offsets.cpp ;
    7885
    7986# We need to specify the dependency on the generated syscalls file explicitly.
  • src/system/kernel/arch/x86/ioapic.cpp

    diff --git a/src/system/kernel/arch/x86/ioapic.cpp b/src/system/kernel/arch/x86/ioapic.cpp
    index 78f6129..6d40b16 100644
    a b acpi_configure_source_overrides(acpi_table_madt* madt)  
    529529                if (info->SourceIrq != info->GlobalIrq) {
    530530                    // we need a vector mapping
    531531                    install_io_interrupt_handler(info->GlobalIrq,
    532                         &ioapic_source_override_handler, (void*)info->SourceIrq,
    533                         B_NO_ENABLE_COUNTER);
     532                        &ioapic_source_override_handler,
     533                        (void*)(addr_t)info->SourceIrq, B_NO_ENABLE_COUNTER);
    534534
    535535                    sSourceOverrides[info->SourceIrq] = info->GlobalIrq;
    536536                }