Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
131 user(s) are online (64 user(s) are browsing Forums)

Members: 2
Guests: 129

beworld, AndreasM, more...

Headlines

 
  Register To Post  

« 1 (2)
Re: Programming question about shared objects
Home away from home
Home away from home


See User information
@afxgroup

Its old thread already, i found the solution :) I just answer to phx because he up thread. But thanks for tips anyway :) I do it exactly like you say already.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: Programming question about shared objects
Just popping in
Just popping in


See User information
@ZeroG
Thanks.
Seems I was blind. Downloaded the same archive some hours ago, but didn't find the #?.so in it... :P

Go to top
Re: Programming question about shared objects
Home away from home
Home away from home


See User information
@kas1e et all

I hope i'm allowed to hijack this thread?

I already spoke with kas1e about that, but would like to hear other solutions aswell.
I'm building a project with shared objects, everything is linked in shared, but libSDL is still linked in statically (I have libSDL.so in place beside the static versions, NO soft-link to SObjs:, because that way it wouldn't work either)

There is no way i found so far to make it work,but to rename libSDL.a and libSDL.la and only keep libSDL.so in place

Is this a bug or is there something i miss in the makefile?

This is the part of configure where it tells to build as shared objects:
Quote:

echo_n "Checking hosttype... "
echo $_host_os
case $_host_os in
amigaos*)
CXXFLAGS="$CXXFLAGS -mcrt=newlib -mstrict-align -mcpu=750 -mtune=7400"
LDFLAGS="$LDFLAGS -mcrt=newlib -use-dynld -Lsobjs:"
# We have to use 'long' for our 4 byte typedef because AmigaOS already typedefs (u)int32
# as (unsigned) long, and consequently we'd get a compiler error otherwise.
type_4_byte='long'
;;


Anyone any ideas, please?
I rather not leave my build system in the state of a renamed libSDL.a(.la)

People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
Go to top
Re: Programming question about shared objects
Amigans Defender
Amigans Defender


See User information
@Raziel

you should not use SOBJS: as directory path but SDK:Local/newib/lib since that is the default search directory.
And i think it has an higher priority over sobjs:

i'm really tired...
Go to top
Re: Programming question about shared objects
Amigans Defender
Amigans Defender


See User information
@Raziel

Check the sdl-config script. You probably have a clib2 and newlib version, IIRC I had to copy the newlib version over the clib2 version to get it to work with newlib. But that was back quite a while ago, maybe not a problem any more.

Go to top
Re: Programming question about shared objects
Home away from home
Home away from home


See User information
@afxgroup

Thanks a lot, that sounds more than sensible, will change it immediatly

@Chris

But wouldn't that break every port that relies on a clib2 build?
Just like it does already for me with the renamed libSDL.a and libSDL.la?

I'd need a general solution to make all ports (with a working makefile) grab the right libs (shared or static) when told

People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
Go to top
Re: Programming question about shared objects
Amigans Defender
Amigans Defender


See User information
@Raziel

It's a case of manually changing it back if you want to use clib2. For some reason the script gets picked up from clib2/bin when compiling with newlib. There's probably a better fix but that worked for me. *shrug*

Go to top
Re: Programming question about shared objects
Home away from home
Home away from home


See User information
@Chris

Understood.

I have yet to determine if the solution from Max worked even with the other problem.

At least one build i did had the shared lib used without me changing anything else...wait and see

edit: Just wanted to say thank you to Andrea, your hint with the wrong path to the shared objects cured my problems, now every time i build with shared objects the right files are picked


Edited by Raziel on 2010/7/25 6:04:03
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
Go to top
Re: Programming question about shared objects
Just can't stay away
Just can't stay away


See User information
@kas1e

Old thread, but I think I have hit the same issue.

I have a binary with statically linked libSDL2.a. SDL2 offers an option to load another libSDL2 dynamically so that the functionality of the original can be overridden. This works when binary is dynamically linked to libSDL2.so (libSDL2.so loading another libSDL2.so), but with statical linking, it grims and stack points to libc.so (NewlibCall).

Is there a correct way to make "static lib loading a dynamic lib" work? I tried to link binary with -Wl,--export-dynamic but it didn't help.

Go to top
Re: Programming question about shared objects
Home away from home
Home away from home


See User information
@Capehill
From my own expirience i learn that on aos4 better do not use sobjes at all, and do use static linking. In that case i can be always sure i will have no strange crashes or some strange problems. Also from users side there will be no sobj-hell (no proper versioning and co), and so it will be easy for users.

But that me :)


Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: Programming question about shared objects
Home away from home
Home away from home


See User information
@Capehill

Quote:

I have a binary with statically linked libSDL2.a. SDL2 offers an option to load another libSDL2 dynamically so that the functionality of the original can be overridden. This works when binary is dynamically linked to libSDL2.so (libSDL2.so loading another libSDL2.so), but with statical linking, it grims and stack points to libc.so (NewlibCall).

Is there a correct way to make "static lib loading a dynamic lib" work? I tried to link binary with -Wl,--export-dynamic but it didn't help.


You cannot load a sobj from statically linked program.

You can dynamically link a prgram and link in static libs too (blender does it in a rather brute force way) but it would seem redundant in this context?

Why link in static libSDL that auto replcaes with a dynamic libSDL, just link with the dynamic one in the first place?

The feature you describe seems designed for a different sort of system.

Go to top
Re: Programming question about shared objects
Just can't stay away
Just can't stay away


See User information
@broadblues

Well, personally I try to use dynamic linking whenever possible. One good reason is that for example SDL1 used LGPL license.

https://plus.google.com/+RyanGordon/posts/TB8UfnDYu4U

Go to top

  Register To Post
« 1 (2)

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project