Ticket #8279: 0001-Added-workarounds-and-options-for-gcc-4.6.2.patch

File 0001-Added-workarounds-and-options-for-gcc-4.6.2.patch, 4.0 KB (added by korli, 12 years ago)

Workarounds for gcc 4.6.2

  • build/jam/BuildSetup

    From 758a945856ea1cde79a04601165d26df68d3b34b Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= <jerome.duval@gmail.com>
    Date: Mon, 16 Jan 2012 23:23:19 +0100
    Subject: [PATCH] Added workarounds and options for gcc 4.6.2
    
    * add -Wno-unused-but-set-variable for gcc 4.6.x with a TODO
    * fix warnings about wrong size of pointer cast in ioapic.cpp and AudioBuffer.cpp
    ---
     build/jam/BuildSetup                          |   28 ++++++++++++------------
     build/scripts/build_cross_tools_gcc4          |    2 +-
     src/apps/cortex/addons/common/AudioBuffer.cpp |    4 +-
     src/system/kernel/arch/x86/ioapic.cpp         |    4 +-
     4 files changed, 19 insertions(+), 19 deletions(-)
    
    diff --git a/build/jam/BuildSetup b/build/jam/BuildSetup
    index c46977e..de35d5f 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-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.
  • build/scripts/build_cross_tools_gcc4

    diff --git a/build/scripts/build_cross_tools_gcc4 b/build/scripts/build_cross_tools_gcc4
    index fa20f7c..3c4ba83 100755
    a b copy_headers $haikuSourceDir/headers/posix $tmpIncludeDir/posix  
    144144cd $gccObjDir
    145145CFLAGS="-O2" CXXFLAGS="-O2" $gccSourceDir/configure --prefix=$installDir \
    146146    --target=$haikuMachine --disable-nls --disable-shared \
    147     --enable-languages=c,c++ \
     147    --enable-languages=c,c++ --enable-lto --enable-frame-pointer \
    148148    --with-headers=$tmpIncludeDir --with-libs=$tmpLibDir \
    149149    $gccConfigureArgs || exit 1
    150150
  • 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/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                }