VM Maker gcc options

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
dsg
Reply | Threaded
Open this post in threaded view
|

VM Maker gcc options

dsg

Hello,
I've got the FreeBSD port building with the VMMaker system, but I can only do it if I manually edit "build/CMakeFiles/CogMTVM.dir/link.txt and remove the "-ldl" option.  I've looked everywhere inside the generator image to find out where this is set, but I'm not having any luck.  The closest thing I've found is CPlatformConfig>>addDriver:sources:generator, but overriding and removing the -ldl options in there doesn't seem to have any effect (also the other options don't match up).  Can anyone point me to where this is set?

Thanks,
David
Reply | Threaded
Open this post in threaded view
|

Re: VM Maker gcc options

Igor Stasenko

On 25 March 2011 22:41, David Graham <[hidden email]> wrote:
>
> Hello,
> I've got the FreeBSD port building with the VMMaker system, but I can only do it if I manually edit "build/CMakeFiles/CogMTVM.dir/link.txt and remove the "-ldl" option.  I've looked everywhere inside the generator image to find out where this is set, but I'm not having any luck.  The closest thing I've found is CPlatformConfig>>addDriver:sources:generator, but overriding and removing the -ldl options in there doesn't seem to have any effect (also the other options don't match up).  Can anyone point me to where this is set?


See
CUnixConfig>>addDriver: name sources: aSources generator: cmakeGen

This code should be factored out into something more appropriate.
So, feel free to add extra methods with nice comments and instead of having:

LINK_FLAGS "-lSM -lICE -ldl -lGL -lpthread -lm -lnsl -lX11"'

it could be made as:

LINK_FLAGS "' , (self driverLibs:name) '"'

and in driverLibs but necessary libraries for driver , appropriate for
driver with given name.

Because it is a bit lame that all drivers are linked with same libs,
even if they are not used by driver.

>
> Thanks,
> David



--
Best regards,
Igor Stasenko AKA sig.
Reply | Threaded
Open this post in threaded view
|

Re: VM Maker gcc options

Igor Stasenko

On 25 March 2011 22:50, Igor Stasenko <[hidden email]> wrote:

> On 25 March 2011 22:41, David Graham <[hidden email]> wrote:
>>
>> Hello,
>> I've got the FreeBSD port building with the VMMaker system, but I can only do it if I manually edit "build/CMakeFiles/CogMTVM.dir/link.txt and remove the "-ldl" option.  I've looked everywhere inside the generator image to find out where this is set, but I'm not having any luck.  The closest thing I've found is CPlatformConfig>>addDriver:sources:generator, but overriding and removing the -ldl options in there doesn't seem to have any effect (also the other options don't match up).  Can anyone point me to where this is set?
>
>
> See
> CUnixConfig>>addDriver: name sources: aSources generator: cmakeGen
>
> This code should be factored out into something more appropriate.
> So, feel free to add extra methods with nice comments and instead of having:
>
> LINK_FLAGS "-lSM -lICE -ldl -lGL -lpthread -lm -lnsl -lX11"'
>
> it could be made as:
>
> LINK_FLAGS "' , (self driverLibs:name) '"'
>
> and in driverLibs but necessary libraries for driver , appropriate for
> driver with given name.
>
> Because it is a bit lame that all drivers are linked with same libs,
> even if they are not used by driver.
>

Of and btw, for the future, if you get stuck like that , use
whole-source code search

type
-ldl

in workspace, select it then right click and in menu select:
   Extended search ... --> method source with it.

>>
>> Thanks,
>> David
>
>
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>



--
Best regards,
Igor Stasenko AKA sig.
Reply | Threaded
Open this post in threaded view
|

Re: VM Maker gcc options

Eliot Miranda-2
In reply to this post by dsg
 
Hi David,

    Igor has answered your query. But here's how to answer it yourself.  Command-Shift-e on Mac, Alt-Shift-e on WIndows, and whatever the equivalent on linux causes the system to browse all methods whose literals include a string containing the selection.  So if you type and select -ldl in a workspace and do Command-Shift-e the method should be presented to you.

HTH,
Eliot

On Fri, Mar 25, 2011 at 2:41 PM, David Graham <[hidden email]> wrote:

Hello,
I've got the FreeBSD port building with the VMMaker system, but I can only do it if I manually edit "build/CMakeFiles/CogMTVM.dir/link.txt and remove the "-ldl" option.  I've looked everywhere inside the generator image to find out where this is set, but I'm not having any luck.  The closest thing I've found is CPlatformConfig>>addDriver:sources:generator, but overriding and removing the -ldl options in there doesn't seem to have any effect (also the other options don't match up).  Can anyone point me to where this is set?

Thanks,
David

dsg
Reply | Threaded
Open this post in threaded view
|

Re: VM Maker gcc options

dsg

Cool! Thanks Eliot and Igor, I figured smalltalk had a shortcut for something like that.  Although I'm using a mac for learning smalltalk, working on this port makes it feels as if I've entered an old school "port the compiler so you can learn the language" situation. :)

I should have described my code more clearly, but by overriding addDriver:sources:generator and removing -ldl in my CogFreeBSDConfig class (which is a subclass of CogUnixConfig, which is a subclass of CUnixConfig), should have had the same effect, correct?

Also, the really strange thing is that the options are different in the link.txt file ("-lm -ldl -lpthread" vs . "-lSM -lICE -ldl -lGL -lm -lnsl -lX11" in CUnixConfig).  Using the search method you guys gave me, I can't find any other references to -ldl in my hierarchy.




On Mar 25, 2011, at 4:54 PM, Eliot Miranda wrote:

> Hi David,
>
>     Igor has answered your query. But here's how to answer it yourself.  Command-Shift-e on Mac, Alt-Shift-e on WIndows, and whatever the equivalent on linux causes the system to browse all methods whose literals include a string containing the selection.  So if you type and select -ldl in a workspace and do Command-Shift-e the method should be presented to you.
>
> HTH,
> Eliot
>
> On Fri, Mar 25, 2011 at 2:41 PM, David Graham <[hidden email]> wrote:
>
> Hello,
> I've got the FreeBSD port building with the VMMaker system, but I can only do it if I manually edit "build/CMakeFiles/CogMTVM.dir/link.txt and remove the "-ldl" option.  I've looked everywhere inside the generator image to find out where this is set, but I'm not having any luck.  The closest thing I've found is CPlatformConfig>>addDriver:sources:generator, but overriding and removing the -ldl options in there doesn't seem to have any effect (also the other options don't match up).  Can anyone point me to where this is set?
>
> Thanks,
> David
>

Reply | Threaded
Open this post in threaded view
|

Re: VM Maker gcc options

Igor Stasenko

On 25 March 2011 23:30, David Graham <[hidden email]> wrote:
>
> Cool! Thanks Eliot and Igor, I figured smalltalk had a shortcut for something like that.  Although I'm using a mac for learning smalltalk, working on this port makes it feels as if I've entered an old school "port the compiler so you can learn the language" situation. :)
>
> I should have described my code more clearly, but by overriding addDriver:sources:generator and removing -ldl in my CogFreeBSDConfig class (which is a subclass of CogUnixConfig, which is a subclass of CUnixConfig), should have had the same effect, correct?
>
Yes, that what you should normally do.

> Also, the really strange thing is that the options are different in the link.txt file ("-lm -ldl -lpthread" vs . "-lSM -lICE -ldl -lGL -lm -lnsl -lX11" in CUnixConfig).  Using the search method you guys gave me, I can't find any other references to -ldl in my hierarchy.
>
Maybe if you generate fresh configs it will disappear? :)

>
>
>
> On Mar 25, 2011, at 4:54 PM, Eliot Miranda wrote:
>
>> Hi David,
>>
>>     Igor has answered your query. But here's how to answer it yourself.  Command-Shift-e on Mac, Alt-Shift-e on WIndows, and whatever the equivalent on linux causes the system to browse all methods whose literals include a string containing the selection.  So if you type and select -ldl in a workspace and do Command-Shift-e the method should be presented to you.
>>
>> HTH,
>> Eliot
>>
>> On Fri, Mar 25, 2011 at 2:41 PM, David Graham <[hidden email]> wrote:
>>
>> Hello,
>> I've got the FreeBSD port building with the VMMaker system, but I can only do it if I manually edit "build/CMakeFiles/CogMTVM.dir/link.txt and remove the "-ldl" option.  I've looked everywhere inside the generator image to find out where this is set, but I'm not having any luck.  The closest thing I've found is CPlatformConfig>>addDriver:sources:generator, but overriding and removing the -ldl options in there doesn't seem to have any effect (also the other options don't match up).  Can anyone point me to where this is set?
>>
>> Thanks,
>> David
>>
>
>



--
Best regards,
Igor Stasenko AKA sig.
dsg
Reply | Threaded
Open this post in threaded view
|

Re: VM Maker gcc options

dsg


>
>> Also, the really strange thing is that the options are different in the link.txt file ("-lm -ldl -lpthread" vs . "-lSM -lICE -ldl -lGL -lm -lnsl -lX11" in CUnixConfig).  Using the search method you guys gave me, I can't find any other references to -ldl in my hierarchy.
>>

Found it!

CUnixConfig>>setExtraTargetProperties:
maker addExternalLibraries:
                #(
                        'm'  "math lib"
                        'dl'  "dynamic loader"
                        'pthread' "posix threads"
                ).

I didn't catch this the first time through and it didn't turn up in the code search without the "-l", but it clicked when I saw the option pattern while following code.  I overrode the method in my class and the FreeBSD build now completes.

If I understand the hudson process correctly, this package needs to get added to the VMMaker repo on squeaksource before the automated build will work?  I placed a fileout on my server:
www.unthinkable.org/dl/CMakeVMMaker-FreeBSD-Cog.st

There are a number of things I need to work on with the FreeBSD port, but I'm just happy that I was able to get it working at this point. :)
Reply | Threaded
Open this post in threaded view
|

Re: VM Maker gcc options

Igor Stasenko

On 26 March 2011 06:37, David Graham <[hidden email]> wrote:

>
>
>>
>>> Also, the really strange thing is that the options are different in the link.txt file ("-lm -ldl -lpthread" vs . "-lSM -lICE -ldl -lGL -lm -lnsl -lX11" in CUnixConfig).  Using the search method you guys gave me, I can't find any other references to -ldl in my hierarchy.
>>>
>
> Found it!
>
> CUnixConfig>>setExtraTargetProperties:
> maker addExternalLibraries:
>                #(
>                        'm'  "math lib"
>                        'dl'  "dynamic loader"
>                        'pthread' "posix threads"
>                ).
>
> I didn't catch this the first time through and it didn't turn up in the code search without the "-l", but it clicked when I saw the option pattern while following code.  I overrode the method in my class and the FreeBSD build now completes.
>
> If I understand the hudson process correctly, this package needs to get added to the VMMaker repo on squeaksource before the automated build will work?  I placed a fileout on my server:
> www.unthinkable.org/dl/CMakeVMMaker-FreeBSD-Cog.st
>
> There are a number of things I need to work on with the FreeBSD port, but I'm just happy that I was able to get it working at this point. :)

Well done! Thanks a lot.

Is it runs as well? Because the thing is that it may compile & link
well, but then don't run because can't link with some libraries at run
time.

--
Best regards,
Igor Stasenko AKA sig.
dsg
Reply | Threaded
Open this post in threaded view
|

Re: VM Maker gcc options

dsg

>
> Well done! Thanks a lot.
>
> Is it runs as well? Because the thing is that it may compile & link
> well, but then don't run because can't link with some libraries at run
> time.
>

I just tested it and no, it doesn't run.  It has the exact problem you mention... it can't find it's own display plugin.  Is there a common fix for this?

Reply | Threaded
Open this post in threaded view
|

Re: VM Maker gcc options

Igor Stasenko

On 26 March 2011 15:47, David Graham <[hidden email]> wrote:

>
>>
>> Well done! Thanks a lot.
>>
>> Is it runs as well? Because the thing is that it may compile & link
>> well, but then don't run because can't link with some libraries at run
>> time.
>>
>
> I just tested it and no, it doesn't run.  It has the exact problem you mention... it can't find it's own display plugin.  Is there a common fix for this?
>
>
Usually this happens for simple reason:
- it cannot load vm-display-xxx drivers because during load, it
depends on another dynamic libraries which not present on your system.

Try build whole thing in debug mode, so you will see what exactly is missing.

--
Best regards,
Igor Stasenko AKA sig.