You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Jonathan Melissant <jo...@gmail.com> on 2012/05/02 10:37:55 UTC
APR for Texas Instruments C6x
Hello,
I've managed to compile APR for the Texas Instruments c6x architecture.
However, I had to make a small modification to /locks/unix/thread_mutex.c:
at line 60, i've changed:
rv = pthread_mutexattr_settype(&mattr, PTHREAD_MUTEX_RECURSIVE);
to
rv = pthread_mutexattr_settype(&mattr, PTHREAD_MUTEX_RECURSIVE_NP);
Maybe this can be automated by specifying an extra define in case of c6x
architecture?
I'm not really familiar enough to do this myself.
Regards,
Jonathan
PS: Building APR was done by issueing:
ac_cv_file__dev_zero=yes ac_cv_func_setpgrp_void=yes
apr_cv_process_shared_works=yes apr_cv_mutex_robust_shared=yes
apr_cv_tcp_nodelay_with_cork=yes ac_cv_sizeof_struct_iovec=8
apr_cv_mutex_recursive=yes ./configure --host=c6x --prefix=$(pwd)/output
CC=/opt/gcc-c6x/bin/c6x-uclinux-gcc AR=/opt/gcc-c6x/bin/c6x-uclinux-ar
IDL_CPP=cpp ARFLAGS=rv CFLAGS=-lpthread --disable-ipv6
make && make install
Re: APR for Texas Instruments C6x
Posted by Nick Kew <ni...@apache.org>.
On 2 May 2012, at 09:37, Jonathan Melissant wrote:
> I've managed to compile APR for the Texas Instruments c6x architecture.
Thanks for sharing!
> However, I had to make a small modification to /locks/unix/thread_mutex.c:
>
> at line 60, i've changed:
>
> rv = pthread_mutexattr_settype(&mattr, PTHREAD_MUTEX_RECURSIVE);
>
> to
>
> rv = pthread_mutexattr_settype(&mattr, PTHREAD_MUTEX_RECURSIVE_NP);
At what level was that required? To compile? To pass the test suite? Or to work
with your application?
> Maybe this can be automated by specifying an extra define in case of c6x architecture?
> I'm not really familiar enough to do this myself.
Neither am I. Guessing from ignorance here:
> PS: Building APR was done by issueing:
Did that come directly from APR's ./configure script? If not, I'd expect whatever
reference you used to derive it might tell you how you could identify it in a #define.
(or if it's a cross-compile then whoever set that up is your local expert).
--
Nick Kew
Re: APR for Texas Instruments C6x
Posted by Philip Martin <ph...@codematters.co.uk>.
Jonathan Melissant <jo...@gmail.com> writes:
> The problem here is that the host system (the c6x architecture) is not
> known to the configure script.
> In libtool, the host system is specified as follows:
>
> # The host system.
> host_alias=c6x
> host=tic6x-unknown-coff
> host_os=coff
>
> Maybe it's a good idea to add this to future builds?
I think that means that config.guess and config.sub need to be updated.
I see that APR has put these files under version control rather than
relying on the build machine to have copies.
--
Philip
APR for Texas Instruments C6x
Posted by Jonathan Melissant <jo...@gmail.com>.
Hello
I finally managed to compile the ARP shared library for the c6x
architecture.
However, I have done it with a very dirty workaround.
First of all I call the configure with:
ac_cv_file__dev_zero=yes ac_cv_func_setpgrp_void=yes
apr_cv_process_shared_works=yes apr_cv_mutex_robust_shared=yes
apr_cv_tcp_nodelay_with_cork=yes ac_cv_sizeof_struct_iovec=8
apr_cv_mutex_recursive=yes ac_enable_shared=yes ac_enable_static=no
./configure --enable-static --host=c6x --prefix=$(pwd)/output
CC=c6x-uclinux-gcc AR=c6x-uclinux-ar IDL_CPP=cpp ARFLAGS=rv --disable-ipv6
OBJDUMP=c6x-uclinux-objdump build_libtool_libs=yes AS=c6x-uclinux-as
NM=c6x-uclinux-nm deplibs_check_method="pass_all" STRIP=c6x-uclinux-strip
RANLIB=c6x-uclinux-ranlib CFLAGS=" -pipe -Os "
Once configuration is done I need to go into libtool file and edit the
following:
(old ---> new)
build_libtool_libs=no --- > build_libtool_libs=yes
deplibs_check_method="unknown" ---> deplibs_check_method="pass_all"
library_names_spec="" --- >
library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix
\${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
then i run make && make install
And voila! :)
The problem here is that the host system (the c6x architecture) is not
known to the configure script.
In libtool, the host system is specified as follows:
# The host system.
host_alias=c6x
host=tic6x-unknown-coff
host_os=coff
Maybe it's a good idea to add this to future builds?
Jonathan
Re: APR for Texas Instruments C6x
Posted by Jonathan Melissant <jo...@gmail.com>.
I made a small typo, "a static library (libapr.so)" should have been "a
shared library (libapr.so)".
The problem thus is that the c6x compiler will not allow me to generate
shared libraries I have compared the .libs folder for a
build with an ARM processor and for the build with the c6x processor, but
the shared library is missing in the last case.
I can understand that the issue might not lie with APR but with the c6x
compiler, however I'm unsure if this is really the case.
Jonathan
2012/5/9 Philip Martin <ph...@codematters.co.uk>
> Jonathan Melissant <jo...@gmail.com> writes:
>
> > next, APR does not generate a static library (libapr.so file) but only a
> > static library (libapr.la). I have tried everything to change this but
> all
> > tries were unsuccesfull.
>
> libapr.la is not a static library, it is a libtool library file. The
> static and shared libraries are located in .libs in the build tree.
>
> --
> Philip
>
Re: APR for Texas Instruments C6x
Posted by Philip Martin <ph...@codematters.co.uk>.
Jonathan Melissant <jo...@gmail.com> writes:
> next, APR does not generate a static library (libapr.so file) but only a
> static library (libapr.la). I have tried everything to change this but all
> tries were unsuccesfull.
libapr.la is not a static library, it is a libtool library file. The
static and shared libraries are located in .libs in the build tree.
--
Philip
Re: APR for Texas Instruments C6x
Posted by Jonathan Melissant <jo...@gmail.com>.
Hello,
In reply to my previous mail :
Chaning to _NP was required to compile it indeed.
I took some arguments to correctly build it from a package in buildroot,
since im building for uclinux, which is also done with buildroot.
Other arguments where derived from a collegue who is also building
applications with the c6x-uclinux compiler..
I actually haven't passed the test-suite as I'm facing some problems with
the fork() statement, which isn't supported by the uclinux.
I should change to vfork() but Im looking to do so without changing all the
code. Is it possbile to make a define fork() vfork() somewhere in the
makefile?
--
next, APR does not generate a static library (libapr.so file) but only a
static library (libapr.la). I have tried everything to change this but all
tries were unsuccesfull.
Any ideas how this should or could be done? I need the static library for
another project that uses APR.
Thanks in advance,
Jonathan
2012/5/2 Jonathan Melissant <jo...@gmail.com>
> Hello,
>
> I've managed to compile APR for the Texas Instruments c6x architecture.
> However, I had to make a small modification to /locks/unix/thread_mutex.c:
>
> at line 60, i've changed:
>
> rv = pthread_mutexattr_settype(&mattr, PTHREAD_MUTEX_RECURSIVE);
>
> to
>
> rv = pthread_mutexattr_settype(&mattr, PTHREAD_MUTEX_RECURSIVE_NP);
>
> Maybe this can be automated by specifying an extra define in case of c6x
> architecture?
> I'm not really familiar enough to do this myself.
>
> Regards,
> Jonathan
>
> PS: Building APR was done by issueing:
>
> ac_cv_file__dev_zero=yes ac_cv_func_setpgrp_void=yes
> apr_cv_process_shared_works=yes apr_cv_mutex_robust_shared=yes
> apr_cv_tcp_nodelay_with_cork=yes ac_cv_sizeof_struct_iovec=8
> apr_cv_mutex_recursive=yes ./configure --host=c6x --prefix=$(pwd)/output
> CC=/opt/gcc-c6x/bin/c6x-uclinux-gcc AR=/opt/gcc-c6x/bin/c6x-uclinux-ar
> IDL_CPP=cpp ARFLAGS=rv CFLAGS=-lpthread --disable-ipv6
>
> make && make install
>
>
>