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 +=
|
1185 | 1185 | |
1186 | 1186 | |
1187 | 1187 | # 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 { |
| 1188 | WERRORFLAGS = ; |
| 1189 | if $(HAIKU_GCC_VERSION[1]) >= 4 { |
1197 | 1190 | # -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 ; |
1203 | 1196 | } |
1204 | 1197 | } |
1205 | 1198 | |
| 1199 | rule 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 | |
1206 | 1206 | # Work-around for GCC 2 problem -- despite -Wno-multichar it reports |
1207 | 1207 | # multichar warnings in headers/private/kernel/debugger_keymaps.h included by |
1208 | 1208 | # src/system/kernel/arch/x86/arch_debug_console.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(
|
223 | 223 | // convert and copy a sample at a time |
224 | 224 | for(; remaining; remaining -= sampleSize) { |
225 | 225 | 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), |
228 | 228 | m_format.format, |
229 | 229 | target.m_format.format); |
230 | 230 | |
diff --git a/src/system/kernel/Jamfile b/src/system/kernel/Jamfile
index 04b3719..2467d81 100644
a
|
b
|
KernelMergeObject kernel_core.o :
|
45 | 45 | real_time_clock.cpp |
46 | 46 | sem.cpp |
47 | 47 | shutdown.cpp |
48 | | signal.cpp |
49 | | system_info.cpp |
50 | | smp.cpp |
51 | 48 | syscalls.cpp |
52 | | team.cpp |
| 49 | system_info.cpp |
53 | 50 | thread.cpp |
54 | 51 | timer.cpp |
55 | 52 | UserEvent.cpp |
… |
… |
KernelMergeObject kernel_core.o :
|
68 | 65 | scheduler_simple_smp.cpp |
69 | 66 | scheduler_tracing.cpp |
70 | 67 | scheduling_analysis.cpp |
| 68 | : $(TARGET_KERNEL_PIC_CCFLAGS) |
| 69 | ; |
| 70 | |
| 71 | OPTIM = -O0 ; |
71 | 72 | |
| 73 | KernelMergeObject kernel_core0.o : |
| 74 | signal.cpp |
| 75 | smp.cpp |
| 76 | team.cpp |
| 77 | |
72 | 78 | : $(TARGET_KERNEL_PIC_CCFLAGS) |
73 | 79 | ; |
74 | 80 | |
… |
… |
KernelLd linkhack.so :
|
103 | 109 | |
104 | 110 | KernelLd kernel_$(TARGET_ARCH) : |
105 | 111 | kernel_cache.o |
| 112 | kernel_core0.o |
106 | 113 | kernel_core.o |
107 | 114 | kernel_debug.o |
108 | 115 | kernel_device_manager.o |
… |
… |
KernelLd kernel_$(TARGET_ARCH) :
|
115 | 122 | kernel_vm.o |
116 | 123 | |
117 | 124 | kernel_arch_$(TARGET_ARCH).o |
| 125 | kernel_arch_$(TARGET_ARCH)0.o |
118 | 126 | kernel_platform_$(TARGET_BOOT_PLATFORM).o |
119 | 127 | |
120 | 128 | linkhack.so |
… |
… |
KernelLd kernel_$(TARGET_ARCH) :
|
137 | 145 | KernelLd kernel.so : |
138 | 146 | kernel_cache.o |
139 | 147 | kernel_core.o |
| 148 | kernel_core0.o |
140 | 149 | kernel_debug.o |
141 | 150 | kernel_device_manager.o |
142 | 151 | kernel_disk_device_manager.o |
… |
… |
KernelLd kernel.so :
|
148 | 157 | kernel_vm.o |
149 | 158 | |
150 | 159 | kernel_arch_$(TARGET_ARCH).o |
| 160 | kernel_arch_$(TARGET_ARCH)0.o |
151 | 161 | kernel_platform_$(TARGET_BOOT_PLATFORM).o |
152 | 162 | |
153 | 163 | linkhack.so |
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 ] ;
|
19 | 19 | KernelMergeObject kernel_arch_x86.o : |
20 | 20 | arch_commpage.cpp |
21 | 21 | arch_cpu.cpp |
22 | | arch_debug.cpp |
23 | 22 | arch_debug_console.cpp |
24 | 23 | arch_elf.cpp |
25 | 24 | arch_int.cpp |
… |
… |
KernelMergeObject kernel_arch_x86.o :
|
74 | 73 | $(TARGET_KERNEL_PIC_CCFLAGS) |
75 | 74 | ; |
76 | 75 | |
| 76 | OPTIM = -O0 ; |
| 77 | |
| 78 | KernelMergeObject kernel_arch_x860.o : |
| 79 | arch_debug.cpp |
| 80 | : |
| 81 | $(TARGET_KERNEL_PIC_CCFLAGS) |
| 82 | ; |
| 83 | |
77 | 84 | CreateAsmStructOffsetsHeader asm_offsets.h : asm_offsets.cpp ; |
78 | 85 | |
79 | 86 | # We need to specify the dependency on the generated syscalls file explicitly. |
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)
|
529 | 529 | if (info->SourceIrq != info->GlobalIrq) { |
530 | 530 | // we need a vector mapping |
531 | 531 | 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); |
534 | 534 | |
535 | 535 | sSourceOverrides[info->SourceIrq] = info->GlobalIrq; |
536 | 536 | } |