Hywel B. Richards | 1 Jul 2008 15:13
Picon

Some feedback on sockets programming using cegcc

I've just come to the end of doing some sockets programming using cegcc, 
and I thought some experiences might be useful to others.

If you use blocking sockets, then things seem to work OK as far as I 
could tell using the newlib POSIX layer. But then, blocking sockets are 
not very exciting, and I wanted to use non-blocking sockets, which opens 
up more potential for weird behaviour.

The first thing to note was that (the same as winsock) you really need 
to wait until the connection is complete before trying to do any 
send()'s or recv()'s. The reason (I think, from memory) is that if you 
rush to using send/recv after initiating the connection, then the error 
message you get when the socket is still connecting is indistinguishable 
from that you get when the socket has disconnected in error (ENOTCONN). 
On linux, for example, you get EAGAIN in this circumstance, which means 
you can get away with some simpler code in some circumstances. I'm not 
sure what the behaviour is on other POSIX systems, or what it is meant 
to be.

The real showstopper to using "newlib sockets", though, was that the 
whole application would rudely exit if the connection was closed at the 
other end, and then you called send() on the socket.

I wondered if this was due to send() ignoring MSG_NOSIGNAL, generating a 
SIGPIPE, and that the uncaught signal was causing a program exit. I did 
try writing a signal handler, which all compiled OK, but did not change 
the behaviour (and no evidence that the signal handler was called). I 
ran the application from the MSVC debugger and saw a "Data Abort" in the 
debugging window when the program exit occurred. I wonder if I had 
written my application as main program rather than a DLL (which is used 
(Continue reading)

janrinze | 5 Jul 2008 14:22
Picon
Favicon

building cegcc on ubuntu 64bit hardy

Hi all,

I have switched to a new PC. Installed Ubuntu 8.04 64 bit and would like
to know the best starting point for compiling/installing cegcc.
On the sourceforge site there is a 0.51 version for cygwin and one for
mandriva. the 0.50 has a src.tgz version which seems platform
independant. Should i get it from SVN or download the mandriva src?

Jan Rinze.

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
Vincent Torri | 5 Jul 2008 14:27
Picon

Re: building cegcc on ubuntu 64bit hardy


Hey,

> I have switched to a new PC. Installed Ubuntu 8.04 64 bit and would like
> to know the best starting point for compiling/installing cegcc.
> On the sourceforge site there is a 0.51 version for cygwin and one for
> mandriva. the 0.50 has a src.tgz version which seems platform
> independant. Should i get it from SVN or download the mandriva src?

i had problems with cegcc tarballs on my 64 bits ubuntu

so i compiled it from svn. It works very well and has some fixed that are, 
imho, quite important.

hint: when you get cegcc from svn, try to avoid the gcc 4.3 subdir. It's 
huge (takes place and time) and you won't compile it anyway.

regards

Vincent Torri

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
janrinze | 5 Jul 2008 15:54
Picon
Favicon

Re: building cegcc on ubuntu 64bit hardy

On Sat, 2008-07-05 at 14:22 +0200, janrinze wrote:
> Hi all,
> 
> I have switched to a new PC. Installed Ubuntu 8.04 64 bit and would like
> to know the best starting point for compiling/installing cegcc.
> On the sourceforge site there is a 0.51 version for cygwin and one for
> mandriva. the 0.50 has a src.tgz version which seems platform
> independant. Should i get it from SVN or download the mandriva src?
> 
> Jan Rinze.

I am a little stuck..
appears I needed some changes on my system (install lot's of packages..)
but that does not make it compile ..

the error below is beyond my resolving capabilities..

/bin/sh ./libtool --tag=CC --mode=link gcc -W -Wall -Wstrict-prototypes
-Wmissing-prototypes -Werror -g -O2   -o ar  arparse.o arlex.o ar.o
not-ranlib.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o
version.o filemode.o ../bfd/libbfd.la ../libiberty/libiberty.a   
libtool: link: gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes
-Werror -g -O2 -o ar arparse.o arlex.o ar.o not-ranlib.o arsup.o
rename.o binemul.o emul_vanilla.o bucomm.o version.o
filemode.o  ../bfd/.libs/libbfd.a ../libiberty/libiberty.a
ar.o: In function `main':
/home/janrinze/Desktop/src/cegcc/cegcc/cegcc/src/binutils/binutils/ar.c:339: multiple
definition of
`main'
arlex.o:/home/janrinze/Desktop/src/cegcc/cegcc/cegcc/src/build-cegcc/binutils/binutils/arlex.c:1:
(Continue reading)

janrinze | 5 Jul 2008 16:17
Picon
Favicon

Re: building cegcc on ubuntu 64bit hardy

On Sat, 2008-07-05 at 15:54 +0200, janrinze wrote:
> On Sat, 2008-07-05 at 14:22 +0200, janrinze wrote:
> > Hi all,
> > 
> > I have switched to a new PC. Installed Ubuntu 8.04 64 bit and would like
> > to know the best starting point for compiling/installing cegcc.
> > On the sourceforge site there is a 0.51 version for cygwin and one for
> > mandriva. the 0.50 has a src.tgz version which seems platform
> > independant. Should i get it from SVN or download the mandriva src?
> > 
> > Jan Rinze.
> 
> I am a little stuck..
> appears I needed some changes on my system (install lot's of packages..)
> but that does not make it compile ..
> 
> the error below is beyond my resolving capabilities..
> 
> /bin/sh ./libtool --tag=CC --mode=link gcc -W -Wall -Wstrict-prototypes
> -Wmissing-prototypes -Werror -g -O2   -o ar  arparse.o arlex.o ar.o
...
> `/home/janrinze/Desktop/src/cegcc/cegcc/cegcc/src/build-cegcc/binutils'
> make: *** [all] Error 2
> 
> Help would be much appreciated.
> Sincerely,
> 
> Jan Rinze.
> 

(Continue reading)

janrinze | 5 Jul 2008 16:37
Picon
Favicon

cegcc-mingw32ce build errors

Hi all,

somehow building cegcc-mingw32ce fails at the folowing error:

*** BFD does not support target arm-unknown-mingw32ce.
*** Look in bfd/config.bfd for supported targets.
make[1]: *** [configure-bfd] Error 1
make[1]: Leaving directory
`/home/janrinze/Desktop/src/cegcc/cegcc/cegcc/src/build-mingw32ce/gdb'
make: *** [all] Error 2

This to me looks like there is either something missing or there needs
to be a change in the build script.
either way the build script hangs here.

Anyone here who may have a solution for this problem?

regards,
Jan Rinze.

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
Vincent Torri | 5 Jul 2008 16:45
Picon

Re: cegcc-mingw32ce build errors


> somehow building cegcc-mingw32ce fails at the folowing error:
>
> *** BFD does not support target arm-unknown-mingw32ce.
> *** Look in bfd/config.bfd for supported targets.
> make[1]: *** [configure-bfd] Error 1
> make[1]: Leaving directory
> `/home/janrinze/Desktop/src/cegcc/cegcc/cegcc/src/build-mingw32ce/gdb'
> make: *** [all] Error 2
>
> This to me looks like there is either something missing or there needs
> to be a change in the build script.
> either way the build script hangs here.
>
> Anyone here who may have a solution for this problem?

i've never tried to compile mingw32ce (yet). I plan to recompile 
everything soon

Maybe Danny can help you, there

regards

Vincent

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
(Continue reading)

Danny Backx | 5 Jul 2008 16:53
Picon
Favicon

Re: cegcc-mingw32ce build errors

I just committed a few changes for gdb. Looks like they were in my build
tree for ages, but I forgot to commit them.

Sorry about that. Let me know if it doesn't solve the problem.

	Danny

On Sat, 2008-07-05 at 16:37 +0200, janrinze wrote:
> Hi all,
> 
> somehow building cegcc-mingw32ce fails at the folowing error:
> 
> *** BFD does not support target arm-unknown-mingw32ce.
> *** Look in bfd/config.bfd for supported targets.
> make[1]: *** [configure-bfd] Error 1
> make[1]: Leaving directory
> `/home/janrinze/Desktop/src/cegcc/cegcc/cegcc/src/build-mingw32ce/gdb'
> make: *** [all] Error 2
> 
> This to me looks like there is either something missing or there needs
> to be a change in the build script.
> either way the build script hangs here.
> 
> Anyone here who may have a solution for this problem?
> 
> regards,
> Jan Rinze.

--

-- 
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info
(Continue reading)

Danny Backx | 5 Jul 2008 17:30
Picon
Favicon

Re: cegcc-mingw32ce build errors

I'm out of time for today, but this comment inside
src/gdb/gdb/configure.ac looks promising :

# Since GDB uses Readline, we need termcap functionality.  In many
# cases this will be provided by the curses library, but some systems
# have a seperate termcap library, or no curses library at all.

	Danny

On Sat, 2008-07-05 at 17:22 +0200, janrinze wrote:
> On Sat, 2008-07-05 at 16:53 +0200, Danny Backx wrote:
> > I just committed a few changes for gdb. Looks like they were in my build
> > tree for ages, but I forgot to commit them.
> > 
> > Sorry about that. Let me know if it doesn't solve the problem.
> > 
> > 	Danny
> > 
> 
> Hi Danny,
> 
> it solves the error but a new one appeared:
> checking for library containing waddstr... no
> checking for library containing tgetent... no
> configure: error: no termcap library found
> make[1]: *** [configure-gdb] Error 1
> make[1]: Leaving directory
> `/home/janrinze/Desktop/src/cegcc/cegcc/cegcc/src/build-mingw32ce/gdb'
> make: *** [all] Error 2
> 
(Continue reading)

janrinze | 5 Jul 2008 17:22
Picon
Favicon

Re: cegcc-mingw32ce build errors

On Sat, 2008-07-05 at 16:53 +0200, Danny Backx wrote:
> I just committed a few changes for gdb. Looks like they were in my build
> tree for ages, but I forgot to commit them.
> 
> Sorry about that. Let me know if it doesn't solve the problem.
> 
> 	Danny
> 

Hi Danny,

it solves the error but a new one appeared:
checking for library containing waddstr... no
checking for library containing tgetent... no
configure: error: no termcap library found
make[1]: *** [configure-gdb] Error 1
make[1]: Leaving directory
`/home/janrinze/Desktop/src/cegcc/cegcc/cegcc/src/build-mingw32ce/gdb'
make: *** [all] Error 2

It seems that termcap is obsolete these days. (according to some google
searches) So how should i go about this error? There seems to be no
package for Ubuntu 8.04 that provides this library.

regards,

Jan Rinze.

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
(Continue reading)


Gmane