some make system work to get x86-64 linux compiles working:

-The biggest problem with linking host libraries (libbe_build and libroot_build) was not having the source files compiled with the -fPIC flag. As far as I can tell, we want to do this on all of the other host platforms as well, so hacked the jam files a bit to add it. 
Forgive me if I've committed more Jamfile sins.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21423 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Travis Geiselbrecht 2007-06-16 19:43:53 +00:00
parent 5acd132fa4
commit 4a9059fb38
6 changed files with 34 additions and 5 deletions

View File

@ -387,6 +387,9 @@ HOST_ASFLAGS = ;
HOST_CCFLAGS += -Wno-multichar ;
HOST_C++FLAGS += -Wno-multichar ;
HOST_PIC_CCFLAGS += -fPIC ;
HOST_PIC_C++FLAGS += -fPIC ;
HOST_KERNEL_CCFLAGS += -finline -fno-builtin
-DBOCHS_DEBUG_HACK=$(BOCHS_DEBUG_HACK) -D_KERNEL_MODE ;
HOST_KERNEL_C++FLAGS += -finline -fno-builtin -fno-exceptions

View File

@ -465,6 +465,10 @@ rule BuildPlatformSharedLibrary
LINKFLAGS on $(target) = [ on $(target) return $(LINKFLAGS) ]
-shared -Xlinker -soname=\"$(target:G=)\" ;
}
local objects = [ FGristFiles $(sources:S=$(SUFOBJ)) ] ;
CCFLAGS on $(objects) += $(HOST_PIC_CCFLAGS) ;
C++FLAGS on $(objects) += $(HOST_PIC_C++FLAGS) ;
}
rule BuildPlatformMergeObject
@ -493,6 +497,28 @@ rule BuildPlatformMergeObject
MergeObject $(target) : $(sources) : $(otherObjects) ;
}
rule BuildPlatformMergeObjectPIC
{
# BuildPlatformMergeObjectPIC <name> : <sources> : <other objects> ;
# Compiles source files and merges the object files to an object file.
# Same as BuildPlatformMergeObject rule but adds position-independent
# flags to the compiler (if any).
# <name>: Name of the object file to create. No grist will be added.
# <sources>: Sources to be compiled. Grist will be added.
# <other objects>: Object files or static libraries to be merged. No grist
# will be added.
#
local target = $(1) ;
local sources = $(2) ;
local otherObjects = $(3) ;
local objects = [ FGristFiles $(sources:S=$(SUFOBJ)) ] ;
CCFLAGS on $(objects) += $(HOST_PIC_CCFLAGS) ;
C++FLAGS on $(objects) += $(HOST_PIC_C++FLAGS) ;
BuildPlatformMergeObject $(target) : $(sources) : $(otherObjects) ;
}
rule BuildPlatformStaticLibrary
{
# BuildPlatformStaticLibrary <lib> : <sources> ;

View File

@ -5,7 +5,7 @@ UseHeaders [ FDirName $(HAIKU_TOP) headers build private shared ] : true ;
USES_BE_API on <libbe_build>app_kit.o = true ;
BuildPlatformMergeObject <libbe_build>app_kit.o :
BuildPlatformMergeObjectPIC <libbe_build>app_kit.o :
Application.cpp
AppMisc.cpp
Message.cpp

View File

@ -6,7 +6,7 @@ UseHeaders [ FDirName $(HAIKU_TOP) headers build private shared ] : true ;
USES_BE_API on <libbe_build>interface_kit.o = true ;
BuildPlatformMergeObject <libbe_build>interface_kit.o :
BuildPlatformMergeObjectPIC <libbe_build>interface_kit.o :
Bitmap.cpp
GraphicsDefs.cpp
Point.cpp

View File

@ -9,7 +9,7 @@ SEARCH_SOURCE += [ FDirName $(SUBDIR) mime ] ;
USES_BE_API on <libbe_build>storage_kit.o = true ;
BuildPlatformMergeObject <libbe_build>storage_kit.o :
BuildPlatformMergeObjectPIC <libbe_build>storage_kit.o :
AppFileInfo.cpp
Directory.cpp
Entry.cpp

View File

@ -5,7 +5,7 @@ UseHeaders [ FDirName $(HAIKU_TOP) headers build private app ] : true ;
USES_BE_API on <libbe_build>support_kit.o = true ;
BuildPlatformMergeObject <libbe_build>support_kit.o :
BuildPlatformMergeObjectPIC <libbe_build>support_kit.o :
Archivable.cpp
BlockCache.cpp
ByteOrder.cpp