Ticket #218 (closed enhancement: fixed)

Opened 2 months ago

Last modified 2 days ago

compilation fix for gcc-4.3.1

Reported by: hiyuh Assigned to: odole
Priority: minor Milestone: Galekid
Component: Bug Fix Version: 1.0
Keywords: gcc4.3 compilation Cc:
Number of hours worked: 1 % Complete: 80
Number of hours remaining: 0

Description

The attached patch does compilation fix for Doduo r262 w/ gcc-4.3.1. I tested this patch w/

cmake \
	-D BUILD_SHARED_LIBS="ON"                   \
	-D CMAKE_COLOR_MAKEFILE="ON"                \
	-D CMAKE_VERBOSE_MAKEFILE="OFF"             \
	-D COMPILE_TESTS="ON"                       \
	-D OWBAL_BENCH_LOAD_TIME="OFF"              \
	-D OWBAL_PLATFORM_MACPORT="OFF"             \
	-D OWBAL_PLATFORM_GRAPHICS="SDL"            \
	-D WEBKIT_DEBUG="RELEASE"                   \
	-D WEBKIT_USE_CC_EXCEPTIONS="OFF"           \
	-D WEBKIT_USE_CC_PIC="ON"                   \
	-D WEBKIT_USE_CC_RTTI="OFF"                 \
	-D WEBKIT_OFFLINE_WEB_APPLICATIONS="ON"     \
	-D WEBKIT_USE_CROSS_DOCUMENT_MESSAGING="ON" \
	-D WEBKIT_USE_DASHBOARD="ON"                \
	-D WEBKIT_USE_DATABASE="ON"                 \
	-D WEBKIT_USE_DOM_STORAGE="ON"              \
	-D WEBKIT_USE_FILESYSTEM="POSIX"            \
	-D WEBKIT_USE_FONTS="FREETYPE"              \
	-D WEBKIT_USE_HTML5_VIDEO="OFF"             \
	-D WEBKIT_USE_I18N="ICU"                    \
	-D WEBKIT_USE_NPAPI="OFF"                   \
	-D WEBKIT_USE_SVG="ON"                      \
	-D WEBKIT_USE_SYSTEMTIME="LINUX"            \
	-D WEBKIT_USE_THREADING="PTHREADS"

Attachments

Doduo-r262-gcc43.patch (13.4 kB) - added by hiyuh on 06/12/08 16:54:58.

Change History

06/12/08 16:54:58 changed by hiyuh

  • attachment Doduo-r262-gcc43.patch added.

06/12/08 17:06:24 changed by odole

  • keywords set to gcc4.3 compilation.
  • owner changed from sroret to odole.
  • status changed from new to assigned.
  • percent set to 80.
  • milestone set to Doduo.

I will review this patch.
Patch does not break compilation with older gcc version.
Have to test it with gcc-4.3 to be sure that everything is ok and to commit it.

06/12/08 17:53:59 changed by jcverdie

patch successfully applied and tested on gcc 4.0.1 on MacOS X

06/12/08 21:37:20 changed by odole

  • hours_worked set to 1.
  • resolution set to fixed.
  • status changed from assigned to closed.
  • percent changed from 80 to 100.
  • hours_togo changed.

committed at revision 268.

07/11/08 14:47:07 changed by odole

  • status changed from closed to reopened.
  • resolution deleted.
  • percent changed from 100 to 80.

With revision [288] new errors occur with gcc-4.3.1:

[ 38%] Building CXX object BAL/OWBAL/Tests/CMakeFiles/owbaltests.dir/Types/TCSpinLockTest.o
In file included from /home/developer/Galekid/BAL/OWBAL/Tests/Types/TCSpinLockTest.h:6,
                 from /home/developer/Galekid/BAL/OWBAL/Tests/Types/TCSpinLockTest.cpp:1:
/home/developer/Galekid/build_gtk_full/generated_link/OWBAL/BCTCSpinLock.h: In member function ‘void TCMalloc_SpinLock::Init()’:
/home/developer/Galekid/build_gtk_full/generated_link/OWBAL/BCTCSpinLock.h:202: erreur: ‘abort’ was not declared in this scope
/home/developer/Galekid/build_gtk_full/generated_link/OWBAL/BCTCSpinLock.h: In member function ‘void TCMalloc_SpinLock::Finalize()’:
/home/developer/Galekid/build_gtk_full/generated_link/OWBAL/BCTCSpinLock.h:205: erreur: ‘abort’ was not declared in this scope
/home/developer/Galekid/build_gtk_full/generated_link/OWBAL/BCTCSpinLock.h: In member function ‘void TCMalloc_SpinLock::Lock()’:
/home/developer/Galekid/build_gtk_full/generated_link/OWBAL/BCTCSpinLock.h:208: erreur: ‘abort’ was not declared in this scope
/home/developer/Galekid/build_gtk_full/generated_link/OWBAL/BCTCSpinLock.h: In member function ‘void TCMalloc_SpinLock::Unlock()’:
/home/developer/Galekid/build_gtk_full/generated_link/OWBAL/BCTCSpinLock.h:211: erreur: ‘abort’ was not declared in this scope
make[2]: *** [BAL/OWBAL/Tests/CMakeFiles/owbaltests.dir/Types/TCSpinLockTest.o] Erreur 1

A workaround would be to disable tests, but a real fix would be better.

07/11/08 14:47:27 changed by odole

  • milestone changed from Doduo to Galekid.

07/11/08 15:17:46 changed by odole

  • status changed from reopened to new.

bug specific to x86_64 architecture. A potential fix could be:

Index: ../BAL/OWBAL/Concretizations/Types/WK/BCTCSpinLockWK.h
===================================================================
--- ../BAL/OWBAL/Concretizations/Types/WK/BCTCSpinLockWK.h      (révision 388)
+++ ../BAL/OWBAL/Concretizations/Types/WK/BCTCSpinLockWK.h      (copie de travail)
@@ -33,7 +33,7 @@
 #ifndef TCMALLOC_INTERNAL_SPINLOCK_H__
 #define TCMALLOC_INTERNAL_SPINLOCK_H__

-#if (PLATFORM(X86) || PLATFORM(PPC)) && (COMPILER(GCC) || COMPILER(MSVC))
+#if (PLATFORM(X86) || PLATFORM(PPC) || PLATFORM(X86_64)) && (COMPILER(GCC) || COMPILER(MSVC))

 #include <time.h>       /* For nanosleep() */

@@ -63,7 +63,7 @@
   inline void Lock() {
     int r;
 #if COMPILER(GCC)
-#if PLATFORM(X86)
+#if PLATFORM(X86) ||  PLATFORM(X86_64)
     __asm__ __volatile__
       ("xchgl %0, %1"
        : "=r"(r), "=m"(lockword_)
@@ -93,7 +93,7 @@

   inline void Unlock() {
 #if COMPILER(GCC)
-#if PLATFORM(X86)
+#if PLATFORM(X86) ||  PLATFORM(X86_64)
     __asm__ __volatile__
       ("movl $0, %0"
        : "=m"(lockword_)
@@ -139,7 +139,7 @@
   while (true) {
     int r;
 #if COMPILER(GCC)
-#if PLATFORM(X86)
+#if PLATFORM(X86) ||  PLATFORM(X86_64)
     __asm__ __volatile__
       ("xchgl %0, %1"
        : "=r"(r), "=m"(*lockword)

Need more tests...

08/19/08 12:14:04 changed by mbensi

  • status changed from new to closed.
  • resolution set to fixed.