Unfortunately no one can be told what fun_plug is - you have to see it for yourself.
You are not logged in.
Hi Guys
I'm trying to build apcupsd for DNS-323 in crosstools environment (Fonz 0.3 environment), configuration is fine, but it require "arm-linux-uclibc-g++" to build it which I cannot found. I tried to create symbol link from arm-linux-uclibc-gcc, it doesn't work. Do anybody know where is g++ for crosstools?
thanks
noodle
Offline
How did you build the cross-compiler? Used the wiki instructions or my fw103-scripts? Not sure about the wiki-version, but my scripts won't build the c++ compiler. You can verify by running
tp@motte:/opt/dns323/fw103$ arm-linux-uclibc-gcc -v Reading specs from /home/tp/bob/fw103-0.2/crosstools/gcc-3.3.x/toolchain_arm/lib/gcc-lib/arm-linux-uclibc/3.3.3/specs Configured with: /home/tp/bob/fw103-0.2/crosstools/gcc-3.3.x/toolchain_build_arm/gcc-3.3.3/configure --prefix=/home/tp/bob/fw103-0.2/crosstools/gcc-3.3.x/toolchain_arm --build=i386-pc-linux-gnu --host=i386-pc-linux-gnu --target=arm-linux-uclibc --enable-languages=c --disable-shared --includedir=/home/tp/bob/fw103-0.2/crosstools/gcc-3.3.x/toolchain_arm/arm-linux-uclibc/include --with-sysroot=/home/tp/bob/fw103-0.2/crosstools/gcc-3.3.x/toolchain_build_arm/uClibc_dev/ --disable-__cxa_atexit --enable-target-optspace --with-gnu-ld --disable-nls --enable-multilib Thread model: posix gcc version 3.3.3
Search for enable-languages. I my case, it shows only c: "--enable-languages=c". In fact, the toolchain build is incomplete, and it should have built another cross-compiler with support for both c and c++. Though, I haven't investigated this, yet.
Offline
I'm using your script. looks like c++ is not build. wiki version build all, I'm rebuilding it by following wiki version now.
Looks like missing gcc-3.3.3-final.
Last edited by noodle (2007-07-27 04:04:26)
Offline
Figure it out, fonz. You missed one patch file: gcc-uclibc-3.3-121-softfloat.patch. So the crosstools.sh didn't finished successfully.
And it works with gcc 34 only, not gcc 4. So, on Fedora system, I installed compat-gcc-34, and export CC=gcc34
# Dimitry Andric <dimitry@andric.com>, 2004-05-01 # # * Removed the extra -lfloat option from LIBGCC_SPEC, since it isn't needed # anymore. (The required functions are now in libgcc.) # # Fixes errors like # arm-softfloat-linux-gnu/3.4.0/../../../../arm-softfloat-linux-gnu/bin/ld: cannot find -lfloat # collect2: ld returned 1 exit status # make[2]: *** [arm-softfloat-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/iconvdata/ISO8859-1.so] Error 1 # when building glibc-2.3.3 with gcc-3.4.0 for arm-softfloat diff -urNd gcc-3.4.0-orig/gcc/config/arm/linux-elf.h gcc-3.4.0/gcc/config/arm/linux-elf.h --- gcc-3.4.0-orig/gcc/config/arm/linux-elf.h 2004-01-31 07:18:11.000000000 +0100 +++ gcc-3.4.0/gcc/config/arm/linux-elf.h 2004-05-01 19:19:06.935979200 +0200 @@ -55,7 +73,7 @@ %{shared:-lc} \ %{!shared:%{profile:-lc_p}%{!profile:-lc}}" -#define LIBGCC_SPEC "%{msoft-float:-lfloat} -lgcc" +#define LIBGCC_SPEC "-lgcc" /* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
Last edited by noodle (2007-07-27 20:40:45)
Offline
noodle wrote:
Figure it out, fonz. You missed one patch file: gcc-uclibc-3.3-121-softfloat.patch. So the crosstools.sh didn't finished successfully.
And it works with gcc 34 only, not gcc 4. So, on Fedora system, I installed compat-gcc-34, and export CC=gcc34
Thanks, this will save me some time this weekend :-)
Offline
Ok, I got crosstools compiled, I got g++, I got apcupsd compiled (install has some problem, because it depend on the system folder layout). I copied executable files, configuration files into dns323, and try to launch it for a quite test.
Guess what I got? "/mnt/sys/fun_plug.d/bin/sh: /mnt/sys/fun_plug.d/bin/apcupsd/apctest: not found". But the file is there and permission is correct.
# ls -l /mnt/sys/fun_plug.d/bin/apcupsd/
-rwxr-xr-x 1 root root 587 Jul 29 17:04 apcaccess
-rwxr-xr-x 1 root root 39710 Jul 29 17:04 apctest
-rwxr-xr-x 1 root root 39710 Jul 29 17:04 apcupsd
-rwxr-xr-x 1 root root 587 Jul 29 17:04 smtp
What could be wrong? Missing library? there has no ".so" file after build. g++ require more library?
Thanks for your advice.
noodle
Offline
noodle wrote:
Ok, I got crosstools compiled, I got g++, I got apcupsd compiled (install has some problem, because it depend on the system folder layout). I copied executable files, configuration files into dns323, and try to launch it for a quite test.
Guess what I got? "/mnt/sys/fun_plug.d/bin/sh: /mnt/sys/fun_plug.d/bin/apcupsd/apctest: not found". But the file is there and permission is correct.
How did you start it?
What is /mnt/sys/? Is it a mount point? Does the mount have the "exec" flag (Ouput of "mount")?
Offline
I start it like: "/mnt/sys/fun_plug.d/bin/apcupsd/apctest --help"
yes, /mnt/sys is my mount point for my USB flash drive. I installed your fun_plug there, and all the others worked fine. I think it has exec flag. The output of mount is:
rootfs on / type rootfs (rw)
/dev/root on / type ext2 (rw)
proc on /proc type proc (rw,nodiratime)
/dev/loop0 on /sys/crfs type cramfs (ro)
/dev/md0 on /mnt/HD_a2 type ext2 (rw)
/dev/md1 on /mnt/HD_b2 type ext2 (rw)
none on /proc/bus/usb type usbfs (rw)
/dev/sdc1 on /mnt/sys type ext2 (rw)
devpts on /dev/pts type devpts (rw)
As I know, only if you have noexec flag, it going show here.
BTW, that dns323-fan, dns323-temp, dns323-spindown is very useful. dns323-spindown is much better way to detect if hard disk is standby or active. I'm thinking to write a new fan control by use them later.
Last edited by noodle (2007-07-31 00:37:25)
Offline
KRH, here is the output of strace:
execve("/mnt/sys/fun_plug.d/bin/apcupsd/apctest", ["/mnt/sys/fun_plug.d/bin/apcupsd/"...], [/* 16 vars */]) = -1 ENOENT (No such file or directory)
write(2, "strace: exec: No such file or di"..., 40strace: exec: No such file or directory
) = 40
_exit(1) = ?
Process 20117 detached
Thanks
Offline
Does it run from e.g. /tmp? Do the other programs fail, too?
What type of file is "/mnt/sys/fun_plug.d/bin/apcupsd/apctest"?
Try
file /mnt/sys/fun_plug.d/bin/apcupsd/apctest ldd /mnt/sys/fun_plug.d/bin/apcupsd/apctest
Why have apctest/apcupsd, and apcaccess/smtp the same size? Are these hard-links?
Offline
All the files I build under /mnt/sys/fun_plug.d/bin/apcupsd folder have problem.
the outputs are:
/ # file /mnt/sys/fun_plug.d/bin/apcupsd/apctest /mnt/sys/fun_plug.d/bin/apcupsd/apctest: ELF 32-bit LSB executable, ARM, version 1, dynamically linked (uses shared libs), not stripped / # ldd /mnt/sys/fun_plug.d/bin/apcupsd/apctest libpthread.so.0 => /lib/libpthread.so.0 (0x00000000) libc.so.0 => /lib/libc.so.0 (0x00000000) /lib/ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x00000000)
I'm not sure why there have same size, but that's what I got after build.
/ # /mnt/sys/fun_plug.d/bin/apcupsd/apcupsd /mnt/sys/fun_plug.d/bin/sh: /mnt/sys/fun_plug.d/bin/apcupsd/apcupsd: not found / # /mnt/sys/fun_plug.d/bin/apcupsd/apctest /mnt/sys/fun_plug.d/bin/sh: /mnt/sys/fun_plug.d/bin/apcupsd/apctest: not found / # /mnt/sys/fun_plug.d/bin/apcupsd/smtp /mnt/sys/fun_plug.d/bin/apcupsd/smtp: line 1: syntax error: word unexpected (expecting ")") / # /mnt/sys/fun_plug.d/bin/apcupsd/apcaccess /mnt/sys/fun_plug.d/bin/apcupsd/apcaccess: line 1: syntax error: word unexpected (expecting ")") / #
/ # file /mnt/sys/fun_plug.d/bin/apcupsd/apcaccess /mnt/sys/fun_plug.d/bin/apcupsd/apcaccess: ELF 32-bit LSB executable, ARM, version 1, corrupted program header size, corrupted section header size
Last edited by noodle (2007-07-31 02:59:28)
Offline
I found some warning in my build log, may occurred this issue, but not sure.
makedepend: warning: action.c (reading /usr/include/stdio.h, line 34): cannot find include file "stddef.h" not in /opt/dns323/funplug-0.3/sys-root/mnt/sys/fun_plug.d/include/stddef.h not in /opt/dns323/funplug-0.3/tmp/apcupsd-3.14.1/include/stddef.h not in /opt/dns323/funplug-0.3/tmp/apcupsd-3.14.1/include/stddef.h not in /usr/include/stddef.h makedepend: warning: action.c (reading /usr/include/bits/types.h, line 31): cannot find include file "stddef.h" not in /opt/dns323/funplug-0.3/sys-root/mnt/sys/fun_plug.d/include/stddef.h not in /opt/dns323/funplug-0.3/tmp/apcupsd-3.14.1/include/stddef.h not in /opt/dns323/funplug-0.3/tmp/apcupsd-3.14.1/include/stddef.h not in /usr/include/stddef.h makedepend: warning: action.c (reading /usr/include/_G_config.h, line 14): cannot find include file "stddef.h" not in /opt/dns323/funplug-0.3/sys-root/mnt/sys/fun_plug.d/include/stddef.h not in /opt/dns323/funplug-0.3/tmp/apcupsd-3.14.1/include/stddef.h not in /opt/dns323/funplug-0.3/tmp/apcupsd-3.14.1/include/stddef.h not in /usr/include/stddef.h
arm-linux-uclibc-ld -g -O apcupsd.o options.o reports.o action.o apcnis.o device.o /opt/dns323/funplug-0.3/tmp/apcupsd-3.14.1/src/drivers/libdrivers.a -lpthread /opt/dns323/funplug-0.3/tmp/apcupsd-3.14.1/src/lib/libapc.a -lsupc++ -o apcupsd arm-linux-uclibc-ld: warning: cannot find entry symbol _start; defaulting to 00009084
Offline