Skip to content

Commit

Permalink
Correctly handle libs and the GC when creating static/shared libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
nddrylliog committed Aug 16, 2010
1 parent 5fcb550 commit 8d7f5fe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
1 change: 0 additions & 1 deletion source/rock/frontend/CommandLine.ooc
Expand Up @@ -439,7 +439,6 @@ CommandLine: class {
params binaryPath = params dynamiclib
//driver = CombineDriver new(params)
params libcache = false // libcache is incompatible with combine driver
params dynGC = true // including the libgc.a would involve creating a DT_TEXTREL
File new(basePath, "lib") mkdirs()
}
}
Expand Down
16 changes: 10 additions & 6 deletions source/rock/frontend/drivers/SequenceDriver.ooc
Expand Up @@ -84,6 +84,7 @@ SequenceDriver: class extends Driver {
}
if(params verbose) println()

doesLib := (params staticlib != null || params dynamiclib != null)
if(params link && (params staticlib == null || params dynamiclib != null)) {

initCompiler(params compiler)
Expand All @@ -97,7 +98,8 @@ SequenceDriver: class extends Driver {
for(define in params defines) {
params compiler defineSymbol(define)
}
for(dynamicLib in params dynamicLibs) {

if(!doesLib) for(dynamicLib in params dynamicLibs) {
params compiler addDynamicLibrary(dynamicLib)
}
for(incPath in params incPath getPaths()) {
Expand All @@ -109,7 +111,7 @@ SequenceDriver: class extends Driver {
for(additional in params additionals) {
params compiler addObjectFile(additional)
}
for(libPath in params libPath getPaths()) {
if(!doesLib) for(libPath in params libPath getPaths()) {
params compiler addLibraryPath(libPath getAbsolutePath())
}

Expand All @@ -119,12 +121,14 @@ SequenceDriver: class extends Driver {
params compiler setOutputPath(module simpleName)
}

libs := getFlagsFromUse(module)
for(lib in libs) {
params compiler addObjectFile(lib)
if(!doesLib) {
libs := getFlagsFromUse(module)
for(lib in libs) {
params compiler addObjectFile(lib)
}
}

if(params enableGC) {
if(params enableGC && !doesLib) {
params compiler addDynamicLibrary("pthread")
if(params dynGC) {
params compiler addDynamicLibrary("gc")
Expand Down

0 comments on commit 8d7f5fe

Please sign in to comment.