Sign up here and you can log into the forum!

cross compile help apache apr for Gen3/SMP

Have a question about devices internals, memory layout, reverse engineering, etc---This is the place for anything so technical that it would cause a n00b's head to 'splode

cross compile help apache apr for Gen3/SMP   

Postby KAD » Thu Jan 22, 2015 11:44 am

hey all

let me first, say I was too tired to post this up with details and cmd line output last night
so most of that will follow later

I need a bit of help trying to cross compile apache apr
the good news is I got my cross compiler set up and working again :D
did some basic stuff last night, zlib, curl, libffi, sqlite, etc ....
those are all working

but it seems there's a long standing very nasty bug in apr make files that causes cross compile problems

so a few basics on my set up (same as before)
ubuntu 12.04 32bit compiling for WD Gen3

Code: Select all
#cat ./toolchain-path.env
# source this script to put your new compiler in the PATH.

PATH=/opt/mips-4.3/bin:$PATH
SMP86XX_TOOLCHAIN_PATH=/opt/mips-4.3
export SMP86XX_TOOLCHAIN_PATH
export COMPILKIND='codesourcery hardfloat glibc release'
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/smp/output/usr/local/lib
export LD_RUN_PATH=$LD_RUN_PATH:/home/smp/output/usr/local/lib
export PKG_CONFIG_PATH="/home/smp/output/usr/local/lib/pkgconfig"
export CPPFLAGS="-I/home/smp/output/usr/local/include"
export CFLAGS="-I/home/smp/output/usr/local/include"
export LDFLAGS="-L/home/smp/output/usr/local/lib"
export CC="/opt/mips-4.3/bin/mipsel-linux-gcc"
export CPP="/opt/mips-4.3/bin/mipsel-linux-cpp"
export CXX="/opt/mips-4.3/bin/mipsel-linux-g++"
export LD="/opt/mips-4.3/bin/mipsel-linux-ld"
export RANLIB="/opt/mips-4.3/bin/mipsel-linux-ranlib"
export AR="/opt/mips-4.3/bin/mipsel-linux-ar"
cd ./apr1-5.1
#source /opt/mips-4.3/toolchain-path.env
#./configure --prefix="/home/kris/smp/output" --host="mipsel-linux" •ac_cv_file__dev_zero="yes" ac_cv_func_setpgrp_void="yes" apr_cv_process_shared_works="yes" apr_cv_mutex_robust_shared="no" apr_cv_tcp_nodelay_with_cork="yes" ac_cv_sizeof_struct_iovec="8" apr_cv_mutex_recursive="yes"
#make



the make cmd errors out on gen_test_char
as described here http://www.gossamer-threads.com/lists/apache/dev/410713

the workaround described is to first compile gen_test_char for local machine X86
Code: Select all
gcc -Wall -O2 -DCROSS_COMPILE gen_test_char.c -s -o gen_test_char
./gen_test_char > gen_test_char.h


indeed this fix does allow make to run longer
but it still errors out later when gen_test_char gets called again in the build process

so anybody actually know how to cross compile apr
I'm actually looking to recompile svn as old binaries and libs don't run on smp
svn required dependancies apr-util and sqlite and of coarse apr-util first require apr

any suggestions or insights ?
If you like my work please consider a Donation. Donate
Please read the appropriate documentation before posting questions! READ ME FAQ WIKI
PM's are for private matters. Post support questions to the appropriate forum, or they will be ignored.
User avatar
KAD
Global Moderator
 
Posts: 5103
Joined: Mon Apr 12, 2010 4:59 pm
Location: Seattle, WA USA

Re: cross compile help apache apr for Gen3/SMP   

Postby KAD » Fri Jan 23, 2015 10:10 am

well, I'm really not find anything useful about how to fix this

I'm finding folks testing various patches - all years old

I think my remaining option would be to set up a cross compile env inside debian chroot - ouch this is gonna take forever :?

but glibc issues should be resolved by setting cross compile options
and anything that needs to run on build machine, should still run because both target and build machine are same processor
only different glibc
If you like my work please consider a Donation. Donate
Please read the appropriate documentation before posting questions! READ ME FAQ WIKI
PM's are for private matters. Post support questions to the appropriate forum, or they will be ignored.
User avatar
KAD
Global Moderator
 
Posts: 5103
Joined: Mon Apr 12, 2010 4:59 pm
Location: Seattle, WA USA

Re: cross compile help apache apr for Gen3/SMP   

Postby KAD » Fri Jan 23, 2015 10:42 pm

I guess, and wait for any suggestions, and come back to this

I can't seem to get toolchain to work correctly from inside squeeze chroot
If you like my work please consider a Donation. Donate
Please read the appropriate documentation before posting questions! READ ME FAQ WIKI
PM's are for private matters. Post support questions to the appropriate forum, or they will be ignored.
User avatar
KAD
Global Moderator
 
Posts: 5103
Joined: Mon Apr 12, 2010 4:59 pm
Location: Seattle, WA USA

Re: cross compile help apache apr for Gen3/SMP   

Postby mad_ady » Sat Jan 24, 2015 8:38 am

Sorry I can't help, because I'm on vacantion, but I will send you b-rad's buildroot environment. It has apr and apr-util and maybe you can add svn... I'll pm you in a few days with details
User avatar
mad_ady
Developer
 
Posts: 4552
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: cross compile help apache apr for Gen3/SMP   

Postby KAD » Sat Jan 24, 2015 12:36 pm

don't worry take your time
enjoy yourself

instead I did some kernel module work today
compiled a working test module
If you like my work please consider a Donation. Donate
Please read the appropriate documentation before posting questions! READ ME FAQ WIKI
PM's are for private matters. Post support questions to the appropriate forum, or they will be ignored.
User avatar
KAD
Global Moderator
 
Posts: 5103
Joined: Mon Apr 12, 2010 4:59 pm
Location: Seattle, WA USA

Re: cross compile help apache apr for Gen3/SMP   

Postby mad_ady » Sun Jan 25, 2015 2:18 am

Yay! Which one?
User avatar
mad_ady
Developer
 
Posts: 4552
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: cross compile help apache apr for Gen3/SMP   

Postby KAD » Sun Jan 25, 2015 10:33 am

it was just a test module, hello world I work :)

actually I'm trying to think of other possible modules that I could test
nfsd.ko, we already know did not work last time I compiled it
vpnc.ko - I have no way to test it
usb to serial - I have no way to test it
tun.ko - then I reviewed config.gz and it's already set to y
aufs.ko, can't seem to find source code, old links for aufs git repo are not valid anymore

fakeusb.ko
virtualkeyboard.ko

would be nice, but I don't have the source
If you like my work please consider a Donation. Donate
Please read the appropriate documentation before posting questions! READ ME FAQ WIKI
PM's are for private matters. Post support questions to the appropriate forum, or they will be ignored.
User avatar
KAD
Global Moderator
 
Posts: 5103
Joined: Mon Apr 12, 2010 4:59 pm
Location: Seattle, WA USA

Re: cross compile help apache apr for Gen3/SMP   

Postby mad_ady » Sun Jan 25, 2015 11:58 am

I'll inform b-rad of your success and I hope he provides the source for virtualkb, but is fakeusb needed? You already need a usb drive plugged in with the custom firmware...
User avatar
mad_ady
Developer
 
Posts: 4552
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: cross compile help apache apr for Gen3/SMP   

Postby KAD » Sun Jan 25, 2015 12:40 pm

I'd prefer some sort of fake usb, so that I can modify the xmount scripts

xmount does work, but the way it works on gen3
I actually have to mount the shares on the attached usb drive
with gen3, it's not enough to put it under /tmp/media/usb
it will not get detected

to further compilicate xmount
if I xmount a share called "test" on the usb drive
if the folder "test" exist and empty when dmaosd starts, dmaosd will flag it as empty and not display it in the osd, regardless of what has been mounted

this required the following script to be run very early in the boot process
https://svn.wdlxtv.com/filedetails.php?repname=2.02.32-wdlxtv-gen3&path=%2Ftrunk%2Fusr%2Fsbin%2Fremove_mount

all in all it works, just wish it was a bit more streamlined
If you like my work please consider a Donation. Donate
Please read the appropriate documentation before posting questions! READ ME FAQ WIKI
PM's are for private matters. Post support questions to the appropriate forum, or they will be ignored.
User avatar
KAD
Global Moderator
 
Posts: 5103
Joined: Mon Apr 12, 2010 4:59 pm
Location: Seattle, WA USA

Re: cross compile help apache apr for Gen3/SMP   

Postby mad_ady » Mon Jan 26, 2015 12:17 am

I don't think fake usb will ever work with your kernel because of the same reason it doesn't work with 1.05's kernel: it has CONFIG_USB_GADGET_TANGOX=y. Previously, the 1.02 kernel had
Code: Select all
# CONFIG_USB_GADGET is not set

... and recliq was able to compile it as a module and point it to a dummy storage. But if it's already built-in, it will not be able to load:

(16:22:27) mad_ady: what were the steps, again?
(16:22:41) recliq: insmod dummy_hcd.ko
(16:22:52) recliq: insmod g_file_storage.ko file=/tmp/fake.bin
(16:22:59) recliq: fake.bin needs to be a filesystem
(16:23:12) mad_ady: it is, but I don't have any dummy_hcd.ko
(16:23:27) mad_ady: only gadgetfs, g_file_storage, g_ether
(16:23:33) mad_ady: kobject_add failed for g_ether with -EEXIST, don't try to register things with the same name in the same directory.
(16:23:33) mad_ady: Call Trace:
(16:23:33) mad_ady: [<840100a0>] dump_stack+0x8/0x34
(16:23:33) mad_ady: [<841cb248>] kobject_shadow_add+0x1c4/0x260
(16:23:33) mad_ady: [<84055900>] mod_sysfs_setup+0x34/0x108
(16:23:33) mad_ady: [<84057658>] sys_init_module+0x1840/0x1d2c
(16:23:33) mad_ady: [<84012c44>] stack_done+0x20/0x3c
(16:23:38) recliq: sec
(16:24:32) recliq: sorry that's exactly the problem
(16:24:46) recliq: here's what happened:
(16:25:08) recliq: Support for USB Gadgets (USB_GADGET) [Y/n/m/?] y
(16:25:08) recliq: Debugging information files (USB_GADGET_DEBUG_FILES) [N/y/?] n
(16:25:08) recliq: USB Peripheral Controller
(16:25:08) recliq: > 1. Tango3 OTG gadget mode support (USB_GADGET_TANGO3)
(16:25:08) recliq: 2. NetChip 228x (USB_GADGET_NET2280)
(16:25:10) recliq: 3. Toshiba TC86C001 'Goku-S' (USB_GADGET_GOKU)
(16:25:12) recliq: 4. Dummy HCD (DEVELOPMENT) (USB_GADGET_DUMMY_HCD)
(16:25:14) recliq: choice[1-4?]: 1
(16:25:16) recliq: USB Gadget Drivers [M/y/?] (NEW) M
(16:25:18) recliq: Gadget Zero (DEVELOPMENT) (USB_ZERO) [N/m/?] n
(16:25:20) recliq: Ethernet Gadget (with CDC Ethernet support) (USB_ETH) [M/n/?] m
(16:25:22) recliq: RNDIS support (EXPERIMENTAL) (USB_ETH_RNDIS) [Y/n/?] y
(16:25:24) recliq: Gadget Filesystem (EXPERIMENTAL) (USB_GADGETFS) [M/n/?] m
(16:25:28) recliq: File-backed Storage Gadget (USB_FILE_STORAGE) [M/n/?] m
(16:25:30) recliq: File-backed Storage Gadget testing version (USB_FILE_STORAGE_TEST) [N/y/?] (NEW)
(16:25:32) recliq: Serial Gadget (with CDC ACM support) (USB_G_SERIAL) [N/m/?] n
(16:25:41) recliq: we can't use dummy_hcd, hence we can't use g_file_storage.ko file=/tmp/fake.bin
(16:26:13) mad_ady: Oh, it's preset to their gadget mode: (USB_GADGET_TANGO3
(16:26:26) mad_ady: and this is inside the kernel
(16:26:32) recliq: yep
(16:26:33) mad_ady: hmm
(16:26:39) mad_ady: interesting problem
(16:27:02) recliq: now that I see the issue again I remember the issue
(16:27:18) recliq: and they don't even use the gadget option
User avatar
mad_ady
Developer
 
Posts: 4552
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Next

Return to WDTV Live

Who is online

Users browsing this forum: No registered users and 3 guests

cron