Openwrt builds next to 17 are not able to auto-detect flash size (TL-WR703N)

Hi, i have this TL-WR703N which i was able to use with openwrt stable or snapshot till version 17. Now, when i use the tiny image from snapshots, (target ath79) the flash runs out of space just by installing luci.

So i was thinking to build openwrt by myself, i already had the repository cloned and a working toolchain, but when i launch "make world", curl is not being built.

configure: loading site script /home/xxxx/.sourcebuilds/openwrt/include/site/mips
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports nested variables... yes
checking whether to enable debug build options... no
checking whether to enable compiler optimizer... (assumed) yes
checking whether to enable strict compiler warnings... no
checking whether to enable compiler warnings as errors... no
checking whether to enable curl debug memory tracking... no
checking whether to enable hiding of library internal symbols... yes
checking whether to enable c-ares for DNS lookups... no
checking whether to disable dependency on -lrt... (assumed no)
checking for path separator... :
checking for sed... /home/xxxx/.sourcebuilds/openwrt/staging_dir/host/bin/sed
checking for grep... /home/xxxx/.sourcebuilds/openwrt/staging_dir/host/bin/grep
checking for egrep... /home/xxxx/.sourcebuilds/openwrt/staging_dir/host/bin/grep -E
configure: using CFLAGS: -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -iremap/home/xxxx/.sourcebuilds/openwrt/build_dir/target-mips_24kc_musl/curl-7.64.0:curl-7.64.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -fpic -ffunction-sections -fdata-sections 
configure: CFLAGS note: CFLAGS should only be used to specify C compiler flags, not macro definitions. Use CPPFLAGS for: -D_FORTIFY_SOURCE=1
configure: WARNING: Continuing even with errors mentioned immediately above this line.
checking for a BSD-compatible install... /usr/bin/install -c
checking for mips-openwrt-linux-gcc... mips-openwrt-linux-musl-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether mips-openwrt-linux-musl-gcc accepts -g... yes
checking for mips-openwrt-linux-musl-gcc option to accept ISO C89... none needed
checking whether mips-openwrt-linux-musl-gcc understands -c and -o together... yes
checking how to run the C preprocessor... mips-openwrt-linux-musl-gcc -E
checking for a sed that does not truncate output... (cached) /home/xxxx/.sourcebuilds/openwrt/staging_dir/host/bin/sed
checking for code coverage support... no
checking whether build environment is sane... yes
checking for mips-openwrt-linux-strip... mips-openwrt-linux-musl-strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking dependency style of mips-openwrt-linux-musl-gcc... gcc3
checking curl version... 7.64.0
checking build system type... x86_64-pc-linux-gnu
checking host system type... mips-openwrt-linux-gnu
checking for grep that handles long lines and -e... (cached) /home/xxxx/.sourcebuilds/openwrt/staging_dir/host/bin/grep
checking for egrep... /home/xxxx/.sourcebuilds/openwrt/staging_dir/host/bin/grep -E
checking if OS is AIX (to define _ALL_SOURCE)... no
checking if _THREAD_SAFE is already defined... no
checking if _THREAD_SAFE is actually needed... no
checking if _THREAD_SAFE is onwards defined... no
checking if _REENTRANT is already defined... no
checking if _REENTRANT is actually needed... no
checking if _REENTRANT is onwards defined... no
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /home/xxxx/.sourcebuilds/openwrt/staging_dir/host/bin/sed
checking for fgrep... /home/xxxx/.sourcebuilds/openwrt/staging_dir/host/bin/grep -F
checking for ld used by mips-openwrt-linux-musl-gcc... mips-openwrt-linux-musl-ld
checking if the linker (mips-openwrt-linux-musl-ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... mips-openwrt-linux-musl-gcc-nm
checking the name lister (mips-openwrt-linux-musl-gcc-nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-pc-linux-gnu file names to mips-openwrt-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for mips-openwrt-linux-musl-ld option to reload object files... -r
checking for mips-openwrt-linux-objdump... mips-openwrt-linux-musl-objdump
checking how to recognize dependent libraries... pass_all
checking for mips-openwrt-linux-dlltool... no
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for mips-openwrt-linux-ar... mips-openwrt-linux-musl-gcc-ar
checking for archiver @FILE support... @
checking for mips-openwrt-linux-strip... (cached) mips-openwrt-linux-musl-strip
checking for mips-openwrt-linux-ranlib... mips-openwrt-linux-musl-gcc-ranlib
checking command to parse mips-openwrt-linux-musl-gcc-nm output from mips-openwrt-linux-musl-gcc object... ok
checking for sysroot... no
checking for mips-openwrt-linux-mt... no
checking for mt... mt
configure: WARNING: using cross tools not prefixed with host triplet
checking if mt is a manifest tool... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if mips-openwrt-linux-musl-gcc supports -fno-rtti -fno-exceptions... no
checking for mips-openwrt-linux-musl-gcc option to produce PIC... -fPIC -DPIC
checking if mips-openwrt-linux-musl-gcc PIC flag -fPIC -DPIC works... yes
checking if mips-openwrt-linux-musl-gcc static flag -static works... yes
checking if mips-openwrt-linux-musl-gcc supports -c -o file.o... yes
checking if mips-openwrt-linux-musl-gcc supports -c -o file.o... (cached) yes
checking whether the mips-openwrt-linux-musl-gcc linker (mips-openwrt-linux-musl-ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking whether to build shared libraries with -version-info... yes
checking whether to build shared libraries with -no-undefined... no
checking whether to build shared libraries with -mimpure-text... no
checking whether to build shared libraries with PIC... yes
checking whether to build static libraries with PIC... no
checking whether to build shared libraries only... no
checking whether to build static libraries only... no
checking for inline... inline
checking if cpp -P is needed... yes
checking if cpp -P works... yes
checking if compiler is DEC/Compaq/HP C... no
checking if compiler is HP-UX C... no
checking if compiler is IBM C... no
checking if compiler is Intel C... no
checking if compiler is clang... no
checking if compiler is GNU C... yes
checking if compiler is LCC... no
checking if compiler is SGI MIPSpro C... no
checking if compiler is SGI MIPS C... no
checking if compiler is SunPro C... no
checking if compiler is Tiny C... no
checking if compiler is Watcom C... no
checking if compiler accepts some basic options... yes
configure: compiler options added: -Werror-implicit-function-declaration 
checking if compiler accepts debug disabling options... yes
configure: compiler options added: 
checking if compiler optimizer assumed setting might be used... no
checking if compiler accepts strict warning options... yes
configure: compiler options added: -Wno-system-headers 
checking if compiler halts on compilation errors... yes
checking if compiler halts on negative sized arrays... yes
checking if compiler halts on function prototype mismatch... yes
checking if compiler supports hiding library internal symbols... yes
checking for windows.h... no
checking whether build target is a native Windows one... no
checking whether build target supports WIN32 file API... no
checking for good-to-use Mac CFLAGS... no
checking to see if the compiler supports __builtin_available()... no
checking whether to support http... yes
checking whether to support ftp... yes
checking whether to support file... yes
checking whether to support ldap... no
checking whether to support ldaps... no
checking whether to support rtsp... no
checking whether to support proxies... yes
checking whether to support dict... no
checking whether to support telnet... no
checking whether to support tftp... no
checking whether to support pop3... no
checking whether to support imap... no
checking whether to support smb... no
checking whether to support smtp... no
checking whether to support gopher... no
checking whether to provide built-in manual... no
checking whether to enable generation of C code... no
checking whether to use libgcc... no
checking if X/Open network library is required... no
checking for gethostbyname... yes
checking for windows.h... (cached) no
checking for winsock.h... (cached) no
checking for winsock2.h... (cached) no
checking for connect in libraries... yes
checking whether time.h and sys/time.h may both be included... yes
checking for sys/types.h... (cached) yes
checking sys/time.h usability... no
checking sys/time.h presence... yes
configure: WARNING: sys/time.h: present but cannot be compiled
configure: WARNING: sys/time.h:     check for missing prerequisite headers?
configure: WARNING: sys/time.h: see the Autoconf documentation
configure: WARNING: sys/time.h:     section "Present But Cannot Be Compiled"
configure: WARNING: sys/time.h: proceeding with the compiler's result
configure: WARNING:     ## ----------------------------------------------------------------------- ##
configure: WARNING:     ## Report this to a suitable curl mailing list: https://curl.haxx.se/mail/ ##
configure: WARNING:     ## ----------------------------------------------------------------------- ##
checking for sys/time.h... no
checking time.h usability... no
checking time.h presence... yes
configure: WARNING: time.h: present but cannot be compiled
configure: WARNING: time.h:     check for missing prerequisite headers?
configure: WARNING: time.h: see the Autoconf documentation
configure: WARNING: time.h:     section "Present But Cannot Be Compiled"
configure: WARNING: time.h: proceeding with the compiler's result
configure: WARNING:     ## ----------------------------------------------------------------------- ##
configure: WARNING:     ## Report this to a suitable curl mailing list: https://curl.haxx.se/mail/ ##
configure: WARNING:     ## ----------------------------------------------------------------------- ##
checking for time.h... no
checking for monotonic clock_gettime... no
configure: WARNING: zlib disabled
checking for BrotliDecoderDecompress in -lbrotlidec... no
checking brotli/decode.h usability... no
checking brotli/decode.h presence... no
checking for brotli/decode.h... no
checking whether to enable IPv6... yes
checking if struct sockaddr_in6 has sin6_scope_id member... no
checking if argv can be written to... no
configure: WARNING: the previous check could not be made default was used
checking if GSS-API support is requested... no
checking whether to enable Windows native SSL/TLS (Windows native builds only)... no
checking whether to enable Apple OS native SSL/TLS... no
checking for mbedtls_ssl_init in -lmbedtls... yes
configure: detected mbedTLS
configure: built with one SSL backend
checking default CA cert bundle/path... /etc/ssl/certs/ca-certificates.crt
checking whether to use builtin CA store of SSL library... no
checking whether versioned symbols are wanted... no
checking whether to enable Windows native IDN (Windows native builds only)... no
checking whether to build with libidn2... no
checking for ANSI C header files... (cached) yes
checking for malloc.h... yes
checking for memory.h... no
checking for sys/types.h... (cached) yes
checking for sys/time.h... (cached) no
checking for sys/select.h... yes
checking for sys/socket.h... no
checking for sys/ioctl.h... yes
checking for sys/uio.h... yes
checking for assert.h... yes
checking for unistd.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for arpa/inet.h... no
checking for net/if.h... no
checking for netinet/in.h... no
checking for netinet/in6.h... no
checking for sys/un.h... yes
checking for linux/tcp.h... yes
checking for netinet/tcp.h... no
checking for netdb.h... no
checking for sys/sockio.h... no
checking for sys/stat.h... (cached) yes
checking for sys/param.h... no
checking for termios.h... yes
checking for termio.h... no
checking for sgtty.h... no
checking for fcntl.h... no
checking for alloca.h... yes
checking for time.h... (cached) no
checking for io.h... no
checking for pwd.h... yes
checking for utime.h... yes
checking for sys/utime.h... no
checking for sys/poll.h... no
checking for poll.h... no
checking for socket.h... no
checking for sys/resource.h... no
checking for libgen.h... yes
checking for locale.h... yes
checking for errno.h... yes
checking for stdbool.h... yes
checking for arpa/tftp.h... yes
checking for sys/filio.h... no
checking for sys/wait.h... no
checking for setjmp.h... yes
checking for an ANSI C-conforming const... yes
checking for compiler support of C99 variadic macro style... yes
checking for compiler support of old gcc variadic macro style... yes
checking for size_t... no
checking whether time.h and sys/time.h may both be included... (cached) yes
checking for sys/types.h... (cached) yes
checking for sys/time.h... (cached) no
checking for time.h... (cached) no
checking for sys/socket.h... (cached) no
checking for struct timeval... no
checking size of size_t... (cached) 4
checking size of long... (cached) 4
checking size of int... (cached) 4
checking size of short... (cached) 2
checking size of time_t... configure: error: cannot determine a size for time_t
make[3]: *** [Makefile:187: /home/xxxx/.sourcebuilds/openwrt/build_dir/target-mips_24kc_musl/curl-7.64.0/.configured_c19406fc3dcbf6f44859297f9cb3067f] Error 1
make[3]: Leaving directory '/home/xxxx/.sourcebuilds/openwrt/package/network/utils/curl'
time: package/network/utils/curl/compile#18.34#1.37#19.08
make[2]: *** [package/Makefile:109: package/network/utils/curl/compile] Error 2
make[2]: Leaving directory '/home/xxxx/.sourcebuilds/openwrt'
make[1]: *** [package/Makefile:103: /home/xxxx/.sourcebuilds/openwrt/staging_dir/target-mips_24kc_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/xxxx/.sourcebuilds/openwrt'
make: *** [/home/xxxx/.sourcebuilds/openwrt/include/toplevel.mk:218: world] Error 2

Am i missing something?

https://openwrt.org/toh/tp-link/tl-wr703n -- 4/32 device.

Why would you believe that you can build a 16 MB image for it?

(Many 4/32 devices are falling off being supportable already, and more will follow quickly.)


Your build environment needs some work as well. I'd try making sure you've got all the pre-reqs and you don't have anything strange in your PATH.

Why would you believe that you can build a 16 MB image for it?

Well, once there was no need to build because i was able to use the whole flash without doing anything, i can't believe it's not working with the latest version.

It was not building because i left selected some packages which required additional care, after removing these and a make clean the build went fine. Now I have a 16m image for the 703n.

Prior to this, i edited the line in the section regarding the 703n /target/linux/ath79/image/tiny-tp-link.mk from 4mlzma to 16mlzma. After flashing the image, the whole memory space is still not available, not even by upgrading u-boot to the latest version. (i use pepe2k's mod, latest release was on 20180223)

Still i can't figure out why this happens.

Hi, I tried with the latest snapshot after 6 months and the auto-detection of the flash size is still not working.

My device is not 4/32, is 16/64. I confirm that owrt versions prior to 17 were able to detect the size of the flash memory without using a dedicated image.

I am using ath79 builds, but also ar71xx builds are affected.

I see that this device is going to be unsupported, but what for those who were modded?

I would like to keep using it.

I also have some TP-Link 4/32 boxes that I upgraded the memory chips to 16/64. I realize that not many people are doing this but it would be nice to have some support in the official builds.

Ath79 uses a dts file where the flash (and RAM) size is hard coded. ar71xx has flash size detection and boot-time dynamic mtd partitioning in the kernel (something like tplinkparts.c). Somehow also the ar71xx build properly detects and uses the extra RAM.

Look here