FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

no space between -L options

 
Post new topic   Reply to topic     Forum Index -> Build
View previous topic :: View next topic  
Author Message
keinfarbton



Joined: 03 Dec 2005
Posts: 224
Location: Stuttgart - Germany

PostPosted: Mon Jun 26, 2006 2:53 pm    Post subject: no space between -L options Reply with quote

If i give build the commandline params
Quote:
... -L-lpthread -L-ldl


it results in the gcc error message:
Quote:
/usr/bin/ld: cannot find -lpthread-ldl


Notice the missing space befor the second -.

A second issue is, -lpthread can be added as a default library to build.
Back to top
View user's profile Send private message
keinfarbton



Joined: 03 Dec 2005
Posts: 224
Location: Stuttgart - Germany

PostPosted: Mon Jun 26, 2006 3:24 pm    Post subject: Reply with quote

With these changes it works for me.

Quote:
Index: build.d
===================================================================
--- build.d (Revision 48)
+++ build.d (Arbeitskopie)
@@ -935,16 +935,16 @@
if (lFileName.length > 0)
{
lCmdItem = lFileName;
- if ( util.str.ends(lCmdItem, "." ~ vLibExtention) == True)
- {
- // Cut off extention.
- lCmdItem.length = lCmdItem.length - vLibExtention.length - 1;
- lLibraryFiles ~= lCmdItem;
- }
- else
- {
+ //if ( util.str.ends(lCmdItem, "." ~ vLibExtention) == True)
+ //{
+ // // Cut off extention.
+ // lCmdItem.length = lCmdItem.length - vLibExtention.length - 1;
+ // lLibraryFiles ~= lCmdItem;
+ //}
+ //else
+ //{
lFilesToLink ~= lCmdItem;
- }
+ //}
}
}

@@ -1121,7 +1121,7 @@
{
if (util.str.begins(lCompileArg, "-L") == True)
{
- lLinkerSwitches ~= lCompileArg[2..$];
+ lLinkerSwitches ~= " " ~ lCompileArg[2..$];
}
}
foreach( char[] lSwitch; std.string.split(vLinkerDefs ~ lLinkerSwitches, "/"))


The first change enables me to put a self build .a on the commandline, the second change adds the space.
Back to top
View user's profile Send private message
keinfarbton



Joined: 03 Dec 2005
Posts: 224
Location: Stuttgart - Germany

PostPosted: Tue Jun 27, 2006 8:33 am    Post subject: Reply with quote

Quote:
Another problem:
Quote:
-Tname

generates the gcc link command with -ofname. Since gcc only needs -o, a executable named fname is generated.

You can configure that. Create or edit the build.cfg file (in the directory that Build is in) to contain the line ...

Code:

INIT:OutFileSwitch = "-o"


Read up on the configuration file in the docs for more details.
Back to top
View user's profile Send private message
keinfarbton



Joined: 03 Dec 2005
Posts: 224
Location: Stuttgart - Germany

PostPosted: Thu Jun 29, 2006 10:48 am    Post subject: Reply with quote

Funny, I think the previous reply was from Derek? But I am sure its not from me Smile

Code:

INIT:OutFileSwitch = "-o"


does not work, because it conflict with the "-op" option and will generate an executable named "p", The "-op" option is now absolutely necessary, because without that all object files are generated in the current directory and overwrite each other if their names collide.

Instead this can work (notice the space):

Code:

INIT:OutFileSwitch = "-o "


I made a new diff to the source:
Code:

Index: build.d
===================================================================
--- build.d     (Revision 48)
+++ build.d     (Arbeitskopie)
@@ -138,6 +138,8 @@
             char[] vLibrarianOpts = `-c -p256`;
             char[] vHomePathId = "HOME";
             char[] vEtcPath    = "";
+           char[]     vSymInfoSwitch = "/co";
+           char[]     vOutFileSwitch = "-of";
         }

         version(Posix) {
@@ -159,16 +161,16 @@
             char[] vLibrarianOpts = `-r`;
             char[] vHomePathId = "HOME";
             char[] vEtcPath    = "/etc/";
+           char[] vSymInfoSwitch = "-g";
+           char[] vOutFileSwitch = "-o ";
         }

         char[]     vVersionSwitch = "-version";
         char[]     vDebugSwitch = "-debug";
         char[][]   vCompilerDefs;
-        char[]     vOutFileSwitch = "-of";
         char[]     vImportPath = "-I";
         bool       vUseModBaseName = false;
         char[]     vLinkLibSwitch = "-l";
-        char[]     vSymInfoSwitch = "/co";
     }

     version(GNU) {
@@ -220,7 +222,7 @@
         char[]     vOutFileSwitch = "-o ";
         char[][]   vCompilerDefs;
         char[]     vImportPath = "-I ";
-        char[]     vSymInfoSwitch = "/co";
+        char[]     vSymInfoSwitch = "-g";
         /* GDC places object files in the directory from which it is called */
         bool       vUseModBaseName = true;
     }
@@ -935,16 +937,16 @@
         if (lFileName.length > 0)
         {
             lCmdItem = lFileName;
-            if ( util.str.ends(lCmdItem, "." ~ vLibExtention) == True)
-            {
-                // Cut off extention.
-                lCmdItem.length = lCmdItem.length - vLibExtention.length - 1;
-                lLibraryFiles ~= lCmdItem;
-            }
-            else
-            {
+            //if ( util.str.ends(lCmdItem, "." ~ vLibExtention) == True)
+            //{
+            //    // Cut off extention.
+            //    lCmdItem.length = lCmdItem.length - vLibExtention.length - 1;
+            //    lLibraryFiles ~= lCmdItem;
+            //}
+            //else
+            //{
                 lFilesToLink ~= lCmdItem;
-            }
+            //}
         }
     }

@@ -1121,7 +1123,7 @@
                 {
                     if (util.str.begins(lCompileArg, "-L") == True)
                     {
-                        lLinkerSwitches ~= lCompileArg[2..$];
+                        lLinkerSwitches ~= " " ~ lCompileArg[2..$];
                     }
                 }
                 foreach( char[] lSwitch; std.string.split(vLinkerDefs ~ lLinkerSwitches, "/"))
Back to top
View user's profile Send private message
brad
Site Admin


Joined: 22 Feb 2004
Posts: 490
Location: Atlanta, GA USA

PostPosted: Fri Jun 30, 2006 12:49 pm    Post subject: Reply with quote

Code:

> patch -p0 < patch3.diff
patching file build.d
Hunk #1 succeeded at 138 with fuzz 2.
missing header for unified diff at line 14 of patch
can't find file to patch at input line 14
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|
|         version(Posix) {
--------------------------
File to patch:

when I try to patch with your latest. Can you email it to me?

BA (brad@dsource.org)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Build All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group