I've downloaded the 4.6 tarball, and via entware-ng I've been able to install the c-compiler tools in my /opt partition, but when I run ./configure for the extracted tar I get a bunch of python warnings, and then an error of "OSError: [Errno 2] No such file or directory"
Code:
./configure configure -j7
Checking for program gcc or cc : /opt/bin/gcc
Checking for program cpp : /opt/bin/cpp
Checking for program ar : /opt/bin/ar
Checking for program ranlib : /opt/bin/ranlib
Checking for gcc : ok
Checking for program git : /opt/usr/bin/git
Check for -MD : yes
Checking for program gdb : /opt/usr/bin/gdb
Checking build system : Linux router 4.4.67 #317 SMP Thu May 11 12:58:51 CEST 2017 armv7l DD-WRT
Checking for header sys/utsname.h : yes
Checking uname sysname type : Traceback (most recent call last):
File "./buildtools/bin/waf", line 76, in <module>
Scripting.prepare(t, cwd, VERSION, wafdir)
File "/opt/test/samba-4.6.4/third_party/waf/wafadmin/Scripting.py", line 145, in prepare
prepare_impl(t, cwd, ver, wafdir)
File "/opt/test/samba-4.6.4/third_party/waf/wafadmin/Scripting.py", line 135, in prepare_impl
main()
File "/opt/test/samba-4.6.4/wscript", line 350, in main
wildcard_main(wildcard_cmd)
File "./buildtools/wafsamba/samba_wildcard.py", line 110, in wildcard_main
fun(ctx)
File "/opt/test/samba-4.6.4/third_party/waf/wafadmin/Scripting.py", line 241, in configure
conf.sub_config([''])
File "/opt/test/samba-4.6.4/third_party/waf/wafadmin/Configure.py", line 237, in sub_config
self.recurse(k, name='configure')
File "/opt/test/samba-4.6.4/third_party/waf/wafadmin/Utils.py", line 656, in recurse
f(self)
File "/opt/test/samba-4.6.4/wscript", line 101, in configure
conf.RECURSE('lib/replace')
File "./buildtools/wafsamba/samba_utils.py", line 451, in RECURSE
return ctx.sub_config(relpath)
File "/opt/test/samba-4.6.4/third_party/waf/wafadmin/Configure.py", line 237, in sub_config
self.recurse(k, name='configure')
File "/opt/test/samba-4.6.4/third_party/waf/wafadmin/Utils.py", line 656, in recurse
f(self)
File "/opt/test/samba-4.6.4/third_party/waf/wafadmin/Utils.py", line 743, in wrap
ret = fun(k)
File "/opt/test/samba-4.6.4/lib/replace/wscript", line 28, in configure
conf.RECURSE('buildtools/wafsamba')
File "./buildtools/wafsamba/samba_utils.py", line 451, in RECURSE
return ctx.sub_config(relpath)
File "/opt/test/samba-4.6.4/third_party/waf/wafadmin/Configure.py", line 237, in sub_config
self.recurse(k, name='configure')
File "/opt/test/samba-4.6.4/third_party/waf/wafadmin/Utils.py", line 656, in recurse
f(self)
File "/opt/test/samba-4.6.4/third_party/waf/wafadmin/Utils.py", line 743, in wrap
ret = fun(k)
File "/opt/test/samba-4.6.4/lib/replace/../../buildtools/wafsamba/wscript", line 308, in configure
conf.CHECK_UNAME()
File "./buildtools/wafsamba/samba_conftests.py", line 452, in CHECK_UNAME
msg="Checking uname %s type" % v):
File "./buildtools/wafsamba/samba_autoconf.py", line 436, in CHECK_CODE
define_ret=define_ret)
File "./buildtools/wafsamba/samba_conftests.py", line 52, in check
ret = self.run_c_code(*k, **kw)
File "/opt/test/samba-4.6.4/third_party/waf/wafadmin/Tools/config_c.py", line 575, in run_c_code
proc = Utils.pproc.Popen([lastprog] + args, stdout=Utils.pproc.PIPE, stderr=Utils.pproc.PIPE)
File "/opt/usr/lib/python2.7/subprocess.py", line 390, in __init__
errread, errwrite)
File "/opt/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
Joined: 26 Mar 2013 Posts: 1858 Location: Hung Hom, Hong Kong
Posted: Thu Jun 01, 2017 15:45 Post subject:
ZacWolf wrote:
I've downloaded the 4.6 tarball, and via entware-ng I've been able to install the c-compiler tools in my /opt partition, but when I run ./configure for the extracted tar I get a bunch of python warnings, and then an error of "OSError: [Errno 2] No such file or directory"
Thank you first for taking the challenge!
Did you install the full Python in your test setup? _________________ Router: Asus RT-N18U (rev. A1)
Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!
Did you install the full Python in your test setup?
So I tried a few different things.
First all, I'm doing this on my router (R8000), that I ran bootstrap on, to build my /opt environment.
I first tried installing python 2.7 via opkg:
opkg install python
The I ran samba-4.6.4/configure and got the errors I posted previously.
Then I installed pthyon 3 via opkg:
opkg install python3
Re-ran and basically got various python syntax errors, that point to syntax changes between python 2 and 3, so python3 won't work.
Then I saw that the samba source directory has a subdirectory: samba-4.6.4/python_install/Python-2.6.5.tar
so I untar'ed that and tried: /.configure
I went down a rabbit hole of trying to get that version of python to build, so I just gave up, and created a symlink to samba-4.6.4/python/bin/python to my opkg install python 2.7
I then reconfigured my PATH to:
/opt/test/samba-4.6.4/buildtools/bin:/opt/sbin:/opt/bin:/opt/usr/sbin:/opt/usr/bin:/bin:/usr/bin:/sbin:/usr/sbin
Then I ran:
/opt/test/samba-4.6.4/install_with_python.sh
And I end up with the original errors I posted. It looks like it is failing at:
Checking uname sysname type
Here's my output from config.log
Code:
# project samba configured on Fri Jun 2 19:12:49 2017 by
# waf 1.5.19 (abi 7, python 2070df0 on linux2)
# using ./buildtools/bin/waf configure --prefix=/opt/test/samba-4.6.4
#
----------------------------------------
Checking for program gcc or cc
find program=['gcc', 'cc'] paths=[] var='CC'
-> '/opt/bin/gcc'
----------------------------------------
Checking for program cpp
find program=['cpp'] paths=[] var='CPP'
-> '/opt/bin/cpp'
----------------------------------------
Checking for program ar
find program=['ar'] paths=[] var='AR'
-> '/opt/bin/ar'
----------------------------------------
Checking for program ranlib
find program=['ranlib'] paths=[] var='RANLIB'
-> '/opt/bin/ranlib'
----------------------------------------
Checking for gcc
ok
----------------------------------------
Checking for program git
find program=['git'] paths=[] var='GIT'
-> '/opt/usr/bin/git'
----------------------------------------
Check for -MD
==>
int main() {return 0;}
OK, I think my problem is that I'm using a combination of kong's optware packages, and openwrt based entware-ng packages.
I tried to compile a basic hello.c, and the resulting binary wouldn't execute.
So I downloaded the DDWRT toolchains, but there are six ARM toolchains and I'm not sure which to use.
Here is the output from my /proc/cpuinfo
Code:
model name : ARMv7 Processor rev 0 (v7l)
processor : 0
BogoMIPS : 1987.37
Features : half fastmult edsp tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part : 0xc09
CPU revision : 0
model name : ARMv7 Processor rev 0 (v7l)
processor : 1
BogoMIPS : 1993.93
Features : half fastmult edsp tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part : 0xc09
CPU revision : 0
Hardware : Northstar Prototype
Revision : 0000
Serial : 0000000000000000
I tried: toolchain-arm_cortex-a9_gcc-6.1.0_musl-1.1.15_eabi
but when I tried to execute some of the apps from /bin I get:
segmentation fault
Am I misunderstanding something basic about the toolchains? Are they for use only for cross-compiling from a 32-bit SuSe Linux build running on an X86 processor, or can they be used on the router itself?
I'd like to setup a proper build environment ON the router itself, is that possible?
Would there be any attention or response on this? Especially with someone (ZacWolf) taking the time to try compiling the binaries on this toolchain - could that (http://www.dd-wrt.com/phpBB2/viewtopic.php?t=309526&sid=19d13f9ef31c21ce2e2d81774f07b6da) get some help having it set up so we can at least have more up-to-date optware options?
This produces binary file: hello
I copy that over to my R8000, and execute: ./hello
...and I still get no output. I get nothing actually, no error, no output, nothing.
I checked, and my R8000 has:
/lib/libc.so
/lib/ld-musl-arm.so.1
I checked my LD_LIBRARY_PATH:
echo $LD_LIBRARY_PATH
/lib:/usr/lib:/jffs/lib:/jffs/usr/lib:/jffs/usr/local/lib:/mmc/lib:/mmc/usr/lib:/opt/lib:/opt/usr/lib
I searched, and libncursesw.so.5 isn't included in the toolchain, so my guess is that Kong is using a different toolchain to build his optware packages?
Kong, can we get access to your optware toolchain?
The silence here from the devs on the topic of upgrading Samba is getting a bit loud. Is it possible? Too large? Too many dependencies would need updated? Just don't have the time to tackle it? Any feedback at all?
Ncurses would not be needed for a simple hello world.
Yeah, if you'll read again, ncurses was being used as a library requirement for an existing Kong Optware package (bash).
The point being, that the bash optware package from the Kong repo wasn't built with the standard DDWRT toolchain, because that toolchain doesn't include ncurses.
Plus, there actually IS an ncurses helloworld:
Code:
#include <ncurses.h>
int main()
{
initscr(); /* Start curses mode */
printw("Hello World !!!"); /* Print Hello World */
refresh(); /* Print it on to the real screen */
getch(); /* Wait for user input */
endwin(); /* End curses mode */
return 0;
}
..that uses printw vs. printf; printf is apparently not always available across embedded devices, which might explain why my original hello binary seemed to execute, but produced no output. This is how I discovered that ncurses wasn't a part of the DDWRT toolchain.
I tried to cross compile the latest ncurses from source (to add to the toolchain), but seems there's an issue doing so from openSUSE. I'll try an earlier version of ncurses tomorrow to see if I can get it added to the toolchain, so that I can test if the lack of output issue is related to printf.
Until I can get a valid toolchain that will build the most basic C code, there's no chance of getting Samba to build.
I get your point on the lack of ncurses indicating kongs toolchain being different than yours. But before spending time on ncurses, is it a dependency of Samba?
...and since I know that samba uses printf for output, apparently it is not a dependency, which points back to some missing option passed into gcc that isn't used in the DDWRT build (i.e. Makefile.northstar)?
At this point, I'm just trying to figure out what will get my simple hello world(s) to generate output, as that will provide me with the best idea of what options will also be necessary to build samba from source.
Sections:
Idx Name Size VMA LMA File off Algn
SYMBOL TABLE:
no symbols
Might provide some clues, so I'll start to google the various symbols, etc. The "HAS_SYMS" of my hello compiled with the DDWRT toolchain might be a big clue.
But ultimately without Kong's toolchain, this is all academic because he's made it clear that he's done something "different" since entware-nt packages aren't interchangeable though they are built for the same architecture. That may be something mundane like different build option, or more likely modifying the kernel or basic libraries to minimize them for an embedded system. At this point I'm just trying anything and seeing what sticks.
I've seen some makefiles on dd-wrt sources with options for removing printf. Also builtin smb binaries doesn't return any text at all, I discovered that when I was trying to get sambas version.
My bet is to use something else to test your hello world, maybe write a file to /tmp?
The change in question is simply changing the default cifs behavior:
instead of defaulting to SMB 1.0 (which you really should not use:
just google for "stop using SMB1" or similar), the default cifs mount
now defaults to a rather more modern SMB 3.0.
Now, because you shouldn't have been using SMB1 anyway, this shouldn't
affect anybody. But guess what? It almost certainly does affect some
people, because they blithely continued using SMB1 without really
thinking about it.
The change in question is simply changing the default cifs behavior:
instead of defaulting to SMB 1.0 (which you really should not use:
just google for "stop using SMB1" or similar), the default cifs mount
now defaults to a rather more modern SMB 3.0.
Now, because you shouldn't have been using SMB1 anyway, this shouldn't
affect anybody. But guess what? It almost certainly does affect some
people, because they blithely continued using SMB1 without really
thinking about it.
So, will we ever have any alternative to SMB1 only samba on dd-wrt, or should we just move on to another firmware?
I was wondering about this since this thread came about. Devs, both Brainslayer and <Kong> have been ignoring this completely. DD-WRT, with my little understanding, only supports SMB1.0. When can we have a more modern/secure solution? Or at least educate us why sticking with SMB1 or Samba3 is a preferred approach here?