Hi guys!
Some time ago I stopped by asking what would one do to compile under Windows, and it was suggested to use cygwin to build the application and than use it with cygwin dll to run it under linux. Well, I'm having some issues to do that...
On Thu, Feb 28, 2013 at 01:56:00PM -0300, Hugo Soares wrote:
Hi,
From here http://bb.osmocom.org/trac/wiki/SIMtrace, I need libosmocore, and I was told by Peter Stuge to use libusb too. Ok... libusb compiled ok under cygwin, now I have cygusb.dll. Now I need libosmocore to produce the dlls I need to use with the host application.
how do you know you do not have DLLs?
CCLD libosmocore.la
it has linked something. You can use make V=1 to get a complete output. On Unix it will write files to src/.libs/*.
CCLD osmo-arfcn.exe
use objdump -x THAT_FILE | less does it link to a DLL? In case you have VisualStudio you can use depends.exe to get a graphical output of that.
holger
Well, I saw it produced something. But since I'm such a noob at autotools and friends I searched for a dll file under libosmocore and didn't find one. When I built libusb, cygusb.dll was generated with no effort on my part.
I'm attaching the output of make V=1 with objdump on exe file. exe file didn't show libosmocore as a dependency dll file.
2013/2/28 Holger Hans Peter Freyther holger@freyther.de
On Thu, Feb 28, 2013 at 01:56:00PM -0300, Hugo Soares wrote:
Hi,
From here http://bb.osmocom.org/trac/wiki/SIMtrace, I need
libosmocore,
and I was told by Peter Stuge to use libusb too. Ok... libusb compiled ok under cygwin, now I have cygusb.dll. Now I need libosmocore to produce the dlls I need to use with the host application.
how do you know you do not have DLLs?
CCLD libosmocore.la
it has linked something. You can use make V=1 to get a complete output. On Unix it will write files to src/.libs/*.
CCLD osmo-arfcn.exe
use objdump -x THAT_FILE | less does it link to a DLL? In case you have VisualStudio you can use depends.exe to get a graphical output of that.
holger
On Thu, Feb 28, 2013 at 05:41:31PM -0300, Hugo Soares wrote:
Hi,
I'm attaching the output of make V=1 with objdump on exe file. exe file didn't show libosmocore as a dependency dll file.
I don't know. Configure libosmocore with --enable-shared --disable-static and see what is happening?
Nothing changed, except from configure output (attached). No dll generated yet. Any ideas?
2013/2/28 Holger Hans Peter Freyther holger@freyther.de
On Thu, Feb 28, 2013 at 05:41:31PM -0300, Hugo Soares wrote:
Hi,
I'm attaching the output of make V=1 with objdump on exe file. exe file didn't show libosmocore as a dependency dll file.
I don't know. Configure libosmocore with --enable-shared --disable-static and see what is happening?
On Thu, Feb 28, 2013 at 06:04:19PM -0300, Hugo Soares wrote:
Nothing changed, except from configure output (attached). No dll generated yet. Any ideas?
checking whether the gcc linker (/usr/i686-pc-cygwin/bin/ld.exe) supports shared libraries... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes
So it wants to build shared libraries. So either you are not looking for them at the right place or they are only created when you do something like make install. The other thing is, use Google and search for libtool, cygwin shared libraries.
cheers holger
Hey Holger!
Many thanks for the help! I was able to build dlls for libosmocore. All I had to do was to give the option '-no-undefined' to libtool, this was done by adding the option to LDFLAGS int the libs makefiles.
Now I'm gonna build the host app.
2013/3/1 Holger Hans Peter Freyther holger@freyther.de
On Thu, Feb 28, 2013 at 06:04:19PM -0300, Hugo Soares wrote:
Nothing changed, except from configure output (attached). No dll
generated
yet. Any ideas?
checking whether the gcc linker (/usr/i686-pc-cygwin/bin/ld.exe)
supports shared libraries... yes
checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes
So it wants to build shared libraries. So either you are not looking for them at the right place or they are only created when you do something like make install. The other thing is, use Google and search for libtool, cygwin shared libraries.
cheers holger
On Fri, Mar 01, 2013 at 10:13:08AM -0300, Hugo Soares wrote:
Hey Holger!
Many thanks for the help! I was able to build dlls for libosmocore. All I had to do was to give the option '-no-undefined' to libtool, this was done by adding the option to LDFLAGS int the libs makefiles.
Hi,
okay. I think the osmogb library is using undefined references right now (this will be cleaned up in the future). Would you mind sending the output of git diff? I can include it in the normal version of libosmocore then.
thanks a lot holger
Hey Holger, I would be very glad to send you the diff and if you guys want, I wouldn't mind making a tutorial on how to compile lib + host on Windows under cygwin.
But for that, it would be nice to have the board loggin :) I finnaly got host application to compile and made inf file to install WinUSB.sys as the board driver. Host application can open device and all but hangs in "Entering main loop"... I've checked for cable continuity and its ok with boarder pins...
Is there any test I can make to assure board is ok?
I have also implemented int bssgp_prim_cb(struct osmo_prim_hdr *oph, void *ctx) { return -1; } to make compilation error go away, is this going to mess up the lib?
Diff is attached.
2013/3/1 Holger Hans Peter Freyther holger@freyther.de
On Fri, Mar 01, 2013 at 10:13:08AM -0300, Hugo Soares wrote:
Hey Holger!
Many thanks for the help! I was able to build dlls for libosmocore. All I had to do was to give the option '-no-undefined' to libtool, this was
done
by adding the option to LDFLAGS int the libs makefiles.
Hi,
okay. I think the osmogb library is using undefined references right now (this will be cleaned up in the future). Would you mind sending the output of git diff? I can include it in the normal version of libosmocore then.
thanks a lot holger
One important note is that phone doesn't camp on network and presents message: "No SIM card." Board is on (red led is on). Maybe I should flash other firmware?
2013/3/1 Hugo Soares hugofredericosoares@gmail.com
Hey Holger, I would be very glad to send you the diff and if you guys want, I wouldn't mind making a tutorial on how to compile lib + host on Windows under cygwin.
But for that, it would be nice to have the board loggin :) I finnaly got host application to compile and made inf file to install WinUSB.sys as the board driver. Host application can open device and all but hangs in "Entering main loop"... I've checked for cable continuity and its ok with boarder pins...
Is there any test I can make to assure board is ok?
I have also implemented int bssgp_prim_cb(struct osmo_prim_hdr *oph, void *ctx) { return -1; } to make compilation error go away, is this going to mess up the lib?
Diff is attached.
2013/3/1 Holger Hans Peter Freyther holger@freyther.de
On Fri, Mar 01, 2013 at 10:13:08AM -0300, Hugo Soares wrote:
Hey Holger!
Many thanks for the help! I was able to build dlls for libosmocore. All
I
had to do was to give the option '-no-undefined' to libtool, this was
done
by adding the option to LDFLAGS int the libs makefiles.
Hi,
okay. I think the osmogb library is using undefined references right now (this will be cleaned up in the future). Would you mind sending the output of git diff? I can include it in the normal version of libosmocore then.
thanks a lot holger
-- Atenciosamente, Hugo Frederico Soares
I have also implemented int bssgp_prim_cb(struct osmo_prim_hdr *oph, void *ctx) { return -1; } to make compilation error go away, is this going to mess up the lib?
Not for simtrace, but it will for some other application.
That also means that the -no-undefined patch can't be merged because it would break compilation AFAICT.
Cheers,
Sylvain
I wouldn't merge this diff as it is since it was done for my personal use and not for community. Putting the flags inside an "if cygwin_environment" would be better.
And good news: I finnaly was able to capture something under Windows. My flex cable was messed up for some reason. Tested with other cable and captured traffic.
One more time, thank you for your time and effort.
Hugo.
2013/3/1 Sylvain Munaut 246tnt@gmail.com
I have also implemented int bssgp_prim_cb(struct osmo_prim_hdr *oph, void *ctx) { return -1; } to make compilation error go away, is this going to mess up the lib?
Not for simtrace, but it will for some other application.
That also means that the -no-undefined patch can't be merged because it would break compilation AFAICT.
Cheers,
Sylvain
On Fri, Mar 01, 2013 at 05:43:22PM -0300, Hugo Soares wrote:
Hi,
And good news: I finnaly was able to capture something under Windows. My flex cable was messed up for some reason. Tested with other cable and captured traffic.
we at sysmocom do not do electrical testing with the flex cables and so far we have had only one defect (the PCB was soldered off-by-one to the cable). You mentioned you made a continuity test and it worked. Have you been able to see what is wrong with the cable? Feel free to use the webshop address of sysmocom to report the defect (if any).
thanks holger
You have probably seen the manual I created. Could you please provide me with some keywords/documentation on your entire setup and the WinUSB.sys/inf configuration?
In fact, I didn't see the manual. The link is a bit difficult to see, being the last line of the page http://bb.osmocom.org/trac/wiki/SIMtrace. Don't you think it should be on top of the page? With big signs point to it? Maybe a blinking tag :)? I'll document my setup and send you, so you can update the manual.
we at sysmocom do not do electrical testing with the flex cables and so far we have had only one defect (the PCB was soldered off-by-one to the cable). You mentioned you made a continuity test and it worked. Have you been able to see what is wrong with the cable? Feel free to use the webshop address of sysmocom to report the defect (if any).
Yes, I indeed did a continuity test and the signal went through all the wires. I really don't know what is wrong with the cable, will do some more testing on it later this week since it is a bit difficult to get one of those where I live.
Thanks.
On Mon, Mar 04, 2013 at 10:24:14AM -0300, Hugo Soares wrote:
In fact, I didn't see the manual. The link is a bit difficult to see, being the last line of the page http://bb.osmocom.org/trac/wiki/SIMtrace. Don't you think it should be on top of the page? With big signs point to it? Maybe a blinking tag :)? I'll document my setup and send you, so you can update the manual.
I added 'Documentation' and refer to the attachments (without a link). Would this have been enough for you?
Yes, I indeed did a continuity test and the signal went through all the wires. I really don't know what is wrong with the cable, will do some more testing on it later this week since it is a bit difficult to get one of those where I live.
feel free to return it by snail mail to sysmocom. I will have a look and will provide you with a replacement.
Ideally I would like to have this work with MinGW as well, then we could build an installer from linux without having to touch windows.
I added 'Documentation' and refer to the attachments (without a link). Would this have been enough for you?
\o/ Much better :)
feel free to return it by snail mail to sysmocom. I will have a look and
will provide you with a replacement.
I'll take another look at the cable later this week. If there's no way of getting it to work, I'll check the returning procedure.
Ideally I would like to have this work with MinGW as well, then we could
build an installer from linux without having to touch windows.
Yes, this would be nice indeed. But I'll only have time to play with simtrace later this week, maybe thursday and friday. I'll get back to you as soon as I have anything to show.
Hugo.
2013/3/4 Holger Hans Peter Freyther holger@freyther.de
On Mon, Mar 04, 2013 at 10:24:14AM -0300, Hugo Soares wrote:
In fact, I didn't see the manual. The link is a bit difficult to see,
being
the last line of the page http://bb.osmocom.org/trac/wiki/SIMtrace.
Don't
you think it should be on top of the page? With big signs point to it? Maybe a blinking tag :)? I'll document my setup and send you, so you can update the manual.
I added 'Documentation' and refer to the attachments (without a link). Would this have been enough for you?
Yes, I indeed did a continuity test and the signal went through all the wires. I really don't know what is wrong with the cable, will do some
more
testing on it later this week since it is a bit difficult to get one of those where I live.
feel free to return it by snail mail to sysmocom. I will have a look and will provide you with a replacement.
Ideally I would like to have this work with MinGW as well, then we could build an installer from linux without having to touch windows.
On Fri, Mar 01, 2013 at 03:18:16PM -0300, Hugo Soares wrote:
Hey Holger, I would be very glad to send you the diff and if you guys want, I wouldn't mind making a tutorial on how to compile lib + host on Windows under cygwin.
I have included the -no-undefined for the core libraries. That should be enough for cygwin and SIMtrace. It would be nice if you could git stash your change, git pull --rebase, make clean; make and see if you have a DLL.
But for that, it would be nice to have the board loggin :) I finnaly got host application to compile and made inf file to install WinUSB.sys as the board driver. Host application can open device and all but hangs in "Entering main loop"...
You have probably seen the manual I created. Could you please provide me with some keywords/documentation on your entire setup and the WinUSB.sys/inf configuration?
thanks holger
Holger Hans Peter Freyther wrote:
okay. I think the osmogb library is using undefined references right now
Making a "nice" DLL is a bit of work, all public API needs to be marked as such, all private API should ideally be static, or gcc seems to export them anyway, there should probably be a .def file which usually needs to be touched manually when new public API is added, and a calling convention should be decided on (I suggest stdcall) and yeah some libtool options. The -no-undefined is a good find Hugo. Sorry that I didn't spot it sooner.
//Peter
Hi,
Making a "nice" DLL is a bit of work, all public API needs to be marked as such, all private API should ideally be static, or gcc seems to export them anyway, there should probably be a .def file which usually needs to be touched manually when new public API is added, and a calling convention should be decided on (I suggest stdcall) and yeah some libtool options.
There is ./gsm/libosmogsm.map and ./gb/libosmogb.map already.
We usually try to have all internal symbols static already because there is the same problem with .so file. osmogsm and gb probably have internal inter-file dependency and that's why we use map files to define visible symbols.
Cheers,
Sylvain
Hi all,
On Sat, Mar 02, 2013 at 04:26:40PM +0100, Sylvain Munaut wrote:
There is ./gsm/libosmogsm.map and ./gb/libosmogb.map already.
We usually try to have all internal symbols static already because there is the same problem with .so file. osmogsm and gb probably have internal inter-file dependency and that's why we use map files to define visible symbols.
Indeed. If we have non-public symbols in libosmocore that pollute the namespace, I'm all for adding a libosmocore.map file in similar fashion.