Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Porting for 1) Natively on termux (Follows aarch64) 2)Ubuntu arm64 /(any other linux distro) running inside proot container on termux #113

Open
tathastu871 opened this issue Jun 30, 2020 · 21 comments

Comments

@tathastu871
Copy link

tathastu871 commented Jun 30, 2020

make config gives following error on arm64 architecture:
make[1]: *** [Makefile:69: configure] Error 2
make: *** [Makefile:88: config] Error 2
Cannot find gnulib/gnulib-tool: No such file or directory. But gnulib is installed and gnulib-tool is in path

@dspinellis
Copy link
Owner

I currently lack access to arm64, but couldn't replicate it on armv7l. I suggest running strace -f -o strace.out make config and examine the strace.out file to see why the failure occurs.

@tathastu871 tathastu871 changed the title Unable to build for arm64 architecture Unable to build for aach64 architecture Sep 15, 2020
@tathastu871 tathastu871 changed the title Unable to build for aach64 architecture Unable to build for aach64 architecture/Porting for termux either using ndk android or using proor arm64 ubuntu os Sep 15, 2020
@tathastu871 tathastu871 changed the title Unable to build for aach64 architecture/Porting for termux either using ndk android or using proor arm64 ubuntu os Unable to build for aach64 architecture/Porting for termux either using ndk android or using proot arm64 ubuntu os Sep 15, 2020
@tathastu871
Copy link
Author

I currently lack access to arm64, but couldn't replicate it on armv7l. I suggest running strace -f -o strace.out make config and examine the strace.out file to see why the failure occurs.

error: use of undeclared identifier 'tmp_fd'           if (fallocate(tmp_fd, FALLOC_FL_PUNCH_HOLE, pool ...                            ^

help solving above error in dgsh-tee.c file

dspinellis added a commit that referenced this issue Sep 22, 2020
@dspinellis
Copy link
Owner

I pushed a fix for the compilation error.

@tathastu871

This comment has been minimized.

dspinellis added a commit that referenced this issue Sep 23, 2020
@dspinellis
Copy link
Owner

Thank you for the persistence! Git pull and run again the configuration process.

@tathastu871

This comment has been minimized.

dspinellis added a commit that referenced this issue Sep 23, 2020
@dspinellis
Copy link
Owner

I also pushed a fix for this.

@tathastu871 tathastu871 changed the title Unable to build for aach64 architecture/Porting for termux either using ndk android or using proot arm64 ubuntu os Port8nf Sep 23, 2020
@tathastu871 tathastu871 changed the title Port8nf Port Sep 23, 2020
@tathastu871 tathastu871 changed the title Port Porting for 1) Natively on termux 2)Ubuntu/(any other linux distro) running indid Sep 23, 2020
@tathastu871 tathastu871 changed the title Porting for 1) Natively on termux 2)Ubuntu/(any other linux distro) running indid Porting for 1) Natively on termux (Follows aarch64) 2)Ubuntu arm64 /(any other linux distro) running inside proot container on termux Sep 23, 2020
@tathastu871

This comment has been minimized.

@tathastu871

This comment has been minimized.

@dspinellis
Copy link
Owner

We're now entering potential GNU bash issues. Can you please first verify that you can compile vanilla bash from source?

@tathastu871
Copy link
Author

9

We're now entering potential GNU bash issues. Can you please first verify that you can compile vanilla bash from source?

Yes bash can be compiled and installed succesfully from source on both termux and ubuntu on termux

@dspinellis
Copy link
Owner

Please try adding the header files in execute_cmd.c rather than in config.h

@tathastu871

This comment has been minimized.

@hnmn
Copy link

hnmn commented Apr 29, 2021

@dspinellis any progress
having dgsh in termux would be great

@dspinellis
Copy link
Owner

Could this be a third party tool problem?

@tathastu871

This comment has been minimized.

@dspinellis
Copy link
Owner

It seems that some porting work is required. I don't have the bandwidth to do this, but I'll gladly integrate a pull request that fixes the issue.

@tathastu871
Copy link
Author

make -C core-tools CFLAGS=""
make[1]: Entering directory '/data/data/com.termux/files/home/dgsh_gm/dgsh/core-tools'
make  all-recursive
make[2]: Entering directory '/data/data/com.termux/files/home/dgsh_gm/dgsh/core-tools'
Making all in src
make[3]: Entering directory '/data/data/com.termux/files/home/dgsh_gm/dgsh/core-tools/src'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/data/data/com.termux/files/home/dgsh_gm/dgsh/core-tools/src'
Making all in .
make[3]: Entering directory '/data/data/com.termux/files/home/dgsh_gm/dgsh/core-tools'
make[3]: Leaving directory '/data/data/com.termux/files/home/dgsh_gm/dgsh/core-tools'
Making all in tests
make[3]: Entering directory '/data/data/com.termux/files/home/dgsh_gm/dgsh/core-tools/tests'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/data/data/com.termux/files/home/dgsh_gm/dgsh/core-tools/tests'
make[2]: Leaving directory '/data/data/com.termux/files/home/dgsh_gm/dgsh/core-tools'
make[1]: Leaving directory '/data/data/com.termux/files/home/dgsh_gm/dgsh/core-tools'
cd core-tools/src && make build-install
make[1]: Entering directory '/data/data/com.termux/files/home/dgsh_gm/dgsh/core-tools/src'
mkdir -p ../../build/bin ../../build/libexec/dgsh
cp dgsh-monitor dgsh-httpval dgsh-readval dgsh-merge-sum ../../build/bin/
cp dgsh-tee dgsh-writeval dgsh-readval dgsh-monitor dgsh-conc dgsh-wrap dgsh-enumerate dgsh-pecho dgsh-fft-input dgsh-w dgsh-parallel perm ../../build/libexec/dgsh/
make[1]: Leaving directory '/data/data/com.termux/files/home/dgsh_gm/dgsh/core-tools/src'
make -C unix-tools make MAKEFLAGS=
make[1]: Entering directory '/data/data/com.termux/files/home/dgsh_gm/dgsh/unix-tools'
make -C bash CFLAGS=""
make[2]: Entering directory '/data/data/com.termux/files/home/dgsh_gm/dgsh/unix-tools/bash'

	  ***********************************************************
	  *                                                         *
	  * GNU bash, version 4.3.46(1)-release (aarch64-unknown-linux-gnu)
	  *                                                         *
	  ***********************************************************

make[2]: Leaving directory '/data/data/com.termux/files/home/dgsh_gm/dgsh/unix-tools/bash'
make -C coreutils
make[2]: Entering directory '/data/data/com.termux/files/home/dgsh_gm/dgsh/unix-tools/coreutils'
make  all-recursive
make[3]: Entering directory '/data/data/com.termux/files/home/dgsh_gm/dgsh/unix-tools/coreutils'
Making all in po
make[4]: Entering directory '/data/data/com.termux/files/home/dgsh_gm/dgsh/unix-tools/coreutils/po'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/data/data/com.termux/files/home/dgsh_gm/dgsh/unix-tools/coreutils/po'
Making all in .
make[4]: Entering directory '/data/data/com.termux/files/home/dgsh_gm/dgsh/unix-tools/coreutils'
  CC       lib/freading.o
  CC       lib/freadseek.o
  CC       lib/freopen-safer.o
  CC       lib/ftoastr.o
  CC       lib/full-read.o
  CC       lib/full-write.o
  CC       lib/gethrxtime.o
  CC       lib/xtime.o
  CC       lib/getndelim2.o
lib/getndelim2.c:164:15: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
          if (GETNDELIM2_MAXIMUM < newsize - offset)
              ^~~~~~~~~~~~~~~~~~
lib/getndelim2.c:64:29: note: expanded from macro 'GETNDELIM2_MAXIMUM'
#define GETNDELIM2_MAXIMUM (PTRDIFF_MAX < SSIZE_MAX ? PTRDIFF_MAX : SSIZE_MAX)
                            ^~~~~~~~~~~
./lib/stdint.h:520:5: note: expanded from macro 'PTRDIFF_MAX'
    _STDINT_MAX (1, 64, 0l)
    ^~~~~~~~~~~~~~~~~~~~~~~
./lib/stdint.h:126:8: note: expanded from macro '_STDINT_MAX'
   ? ~ _STDINT_MIN (signed, bits, zero) \
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./lib/stdint.h:122:31: note: expanded from macro '_STDINT_MIN'
  ((signed) ? (- ((zero) + 1) << ((bits) ? (bits) - 1 : 0)) : (zero))
               ~~~~~~~~~~~~~~ ^
lib/getndelim2.c:166:44: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
              size_t newsizemax = offset + GETNDELIM2_MAXIMUM + 1;
                                           ^~~~~~~~~~~~~~~~~~
lib/getndelim2.c:64:29: note: expanded from macro 'GETNDELIM2_MAXIMUM'
#define GETNDELIM2_MAXIMUM (PTRDIFF_MAX < SSIZE_MAX ? PTRDIFF_MAX : SSIZE_MAX)
                            ^~~~~~~~~~~
./lib/stdint.h:520:5: note: expanded from macro 'PTRDIFF_MAX'
    _STDINT_MAX (1, 64, 0l)
    ^~~~~~~~~~~~~~~~~~~~~~~
./lib/stdint.h:126:8: note: expanded from macro '_STDINT_MAX'
   ? ~ _STDINT_MIN (signed, bits, zero) \
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./lib/stdint.h:122:31: note: expanded from macro '_STDINT_MIN'
  ((signed) ? (- ((zero) + 1) << ((bits) ? (bits) - 1 : 0)) : (zero))
               ~~~~~~~~~~~~~~ ^
2 warnings generated.
  CC       lib/gettime.o
  CC       lib/getugroups.o
  CC       lib/hard-locale.o
  CC       lib/hash.o
lib/hash.c:549:11: warning: implicit conversion from 'unsigned long' to 'float' changes value from 18446744073709551615 to 18446744073709551616 [-Wimplicit-const-int-float-conversion]
      if (SIZE_MAX <= new_candidate)
          ^~~~~~~~ ~~
./lib/stdint.h:543:20: note: expanded from macro 'SIZE_MAX'
# define SIZE_MAX  _STDINT_MAX (0, 64, 0ul)
                   ^~~~~~~~~~~~~~~~~~~~~~~~
./lib/stdint.h:130:71: note: expanded from macro '_STDINT_MAX'
     ((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
lib/hash.c:1079:15: warning: implicit conversion from 'unsigned long' to 'float' changes value from 18446744073709551615 to 18446744073709551616 [-Wimplicit-const-int-float-conversion]
          if (SIZE_MAX <= candidate)
              ^~~~~~~~ ~~
./lib/stdint.h:543:20: note: expanded from macro 'SIZE_MAX'
# define SIZE_MAX  _STDINT_MAX (0, 64, 0ul)
                   ^~~~~~~~~~~~~~~~~~~~~~~~
./lib/stdint.h:130:71: note: expanded from macro '_STDINT_MAX'
     ((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
2 warnings generated.
  CC       lib/hash-pjw.o
  CC       lib/hash-triple.o
  CC       lib/heap.o
  CC       lib/human.o
  CC       lib/i-ring.o
  CC       lib/idcache.o
  CC       lib/ino-map.o
  CC       lib/imaxtostr.o
  CC       lib/inttostr.o
  CC       lib/offtostr.o
  CC       lib/uinttostr.o
  CC       lib/umaxtostr.o
  CC       lib/ldtoastr.o
  CC       lib/linebuffer.o
  CC       lib/localcharset.o
  CC       lib/glthread/lock.o
In file included from lib/glthread/lock.c:23:
./lib/glthread/lock.h:147:17: warning: weak identifier 'pthread_cancel' never declared
#   pragma weak pthread_cancel
                ^
1 warning generated.
  CC       lib/long-options.o
  CC       lib/malloca.o
  CC       lib/math.o
  CC       lib/mbchar.o
  CC       lib/mbiter.o
  CC       lib/mbsalign.o
  CC       lib/mbscasecmp.o
  CC       lib/mbslen.o
  CC       lib/mbsstr.o
  CC       lib/mbswidth.o
  CC       lib/mbuiter.o
  CC       lib/memcasecmp.o
  CC       lib/memchr2.o
  CC       lib/memcmp2.o
  CC       lib/memcoll.o
  CC       lib/mgetgroups.o
  CC       lib/mkancesdirs.o
  CC       lib/dirchownmod.o
  CC       lib/mkdir-p.o
  CC       lib/modechange.o
  CC       lib/mpsort.o
  CC       lib/nproc.o
  CC       lib/openat-die.o
  CC       lib/openat-safer.o
  CC       lib/parse-datetime.o
./lib/parse-datetime.y:876:17: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value]
  if (24 * 60 < abs (n_minutes))
                ^
./lib/parse-datetime.y:876:17: note: use function 'labs' instead
  if (24 * 60 < abs (n_minutes))
                ^~~
                labs
1 warning generated.
  CC       lib/physmem.o
  CC       lib/posixtm.o
  CC       lib/posixver.o
  CC       lib/printf-frexp.o
  CC       lib/printf-frexpl.o
  CC       lib/priv-set.o
  CC       lib/progname.o
  CC       lib/propername.o
  CC       lib/qcopy-acl.o
  CC       lib/qset-acl.o
  CC       lib/quotearg.o
  CC       lib/randint.o
  CC       lib/randperm.o
  CC       lib/randread.o
  CC       lib/rand-isaac.o
  CC       lib/read-file.o
  CC       lib/readtokens.o
  CC       lib/readtokens0.o
  CC       lib/root-dev-ino.o
  CC       lib/safe-read.o
  CC       lib/safe-write.o
  CC       lib/same.o
  CC       lib/save-cwd.o
  CC       lib/savedir.o
  CC       lib/savewd.o
  CC       lib/se-context.o
  CC       lib/se-selinux.o
  CC       lib/settime.o
  CC       lib/sig-handler.o
  CC       lib/sockets.o
  CC       lib/stat-time.o
  CC       lib/statat.o
  CC       lib/mkstemp-safer.o
  CC       lib/strftime.o
  CC       lib/striconv.o
  CC       lib/strnlen1.o
  CC       lib/strintcmp.o
  CC       lib/strnumcmp.o
  CC       lib/sys_socket.o
  CC       lib/tempname.o
  CC       lib/glthread/threadlib.o
  CC       lib/timespec.o
  CC       lib/glthread/tls.o
In file included from lib/glthread/tls.c:21:
./lib/glthread/tls.h:79:17: warning: weak identifier 'pthread_cancel' never declared
#   pragma weak pthread_cancel
                ^
1 warning generated.
  CC       lib/trim.o
  CC       lib/u64.o
  CC       lib/unicodeio.o
  CC       lib/unistd.o
  CC       lib/dup-safer.o
  CC       lib/fd-safer.o
  CC       lib/pipe-safer.o
  CC       lib/unistr/u8-mbtoucr.o
  CC       lib/unistr/u8-uctomb.o
  CC       lib/unistr/u8-uctomb-aux.o
  CC       lib/uniwidth/width.o
  CC       lib/userspec.o
  CC       lib/utimecmp.o
lib/utimecmp.c:292:36: warning: bitwise negation of a boolean expression; did you mean logical negation? [-Wbool-operation]
                time_t s = src_s & ~ (res == 2 * BILLION);
                                   ^~~~~~~~~~~~~~~~~~~~~~
                                   !
lib/utimecmp.c:371:16: warning: bitwise negation of a boolean expression; did you mean logical negation? [-Wbool-operation]
      src_s &= ~ (res == 2 * BILLION);
               ^~~~~~~~~~~~~~~~~~~~~~
               !
2 warnings generated.
  CC       lib/utimens.o
  CC       lib/verror.o
  CC       lib/version-etc.o
  CC       lib/version-etc-fsf.o
  CC       lib/wctype-h.o
  CC       lib/write-any-file.o
  CC       lib/xmalloc.o
  CC       lib/xalloc-die.o
  CC       lib/xdectoimax.o
  CC       lib/xdectoumax.o
  CC       lib/xfreopen.o
  CC       lib/xfts.o
  CC       lib/xgetcwd.o
  CC       lib/xgetgroups.o
  CC       lib/xgethostname.o
  CC       lib/xmemcoll.o
  CC       lib/xnanosleep.o
  CC       lib/xprintf.o
  CC       lib/xreadlink.o
  CC       lib/xsize.o
  CC       lib/xstriconv.o
  CC       lib/xstrndup.o
  CC       lib/xstrtod.o
  CC       lib/xstrtoimax.o
  CC       lib/xstrtol.o
  CC       lib/xstrtoul.o
  CC       lib/xstrtol-error.o
  CC       lib/xstrtold.o
  CC       lib/xstrtoumax.o
  CC       lib/xvasprintf.o
  CC       lib/xasprintf.o
  CC       lib/yesno.o
  CC       lib/asnprintf.o
  CC       lib/asprintf.o
  CC       lib/at-func2.o
  CC       lib/calloc.o
  CC       lib/chdir-long.o
  CC       lib/euidaccess.o
  CC       lib/fclose.o
  CC       lib/fcntl.o
  CC       lib/fflush.o
  CC       lib/fnmatch.o
  CC       lib/freadahead.o
  CC       lib/freadptr.o
  CC       lib/frexp.o
  CC       lib/frexpl.o
  CC       lib/fseek.o
  CC       lib/fseeko.o
  CC       lib/fseterr.o
  CC       lib/fsusage.o
  CC       lib/fts.o
  CC       lib/futimens.o
  CC       lib/getcwd.o
  CC       lib/getcwd-lgpl.o
  CC       lib/getdtablesize.o
  CC       lib/getloadavg.o
  CC       lib/getpass.o
  CC       lib/getusershell.o
  CC       lib/group-member.o
  CC       lib/isapipe.o
  CC       lib/isnanf.o
  CC       lib/isnanl.o
  CC       lib/linkat.o
  CC       lib/mbrlen.o
  CC       lib/mbrtowc.o
  CC       lib/mktime.o
  CC       lib/mountlist.o
lib/mountlist.c:534:26: warning: implicit declaration of function 'makedev' is invalid in C99 [-Wimplicit-function-declaration]
            me->me_dev = makedev (devmaj, devmin);
                         ^
1 warning generated.
  CC       lib/nanosleep.o
  CC       lib/nl_langinfo.o
lib/nl_langinfo.c:151:1: error: redefinition of 'nl_langinfo'
nl_langinfo (nl_item item)
^
/data/data/com.termux/files/usr/include/langinfo.h:177:14: note: previous definition is here
static char *nl_langinfo(nl_item item)
             ^
lib/nl_langinfo.c:175:10: error: use of undeclared identifier 'GROUPING'
    case GROUPING:
         ^
lib/nl_langinfo.c:283:10: error: use of undeclared identifier 'INT_CURR_SYMBOL'
    case INT_CURR_SYMBOL:
         ^
lib/nl_langinfo.c:285:10: error: use of undeclared identifier 'MON_DECIMAL_POINT'
    case MON_DECIMAL_POINT:
         ^
lib/nl_langinfo.c:287:10: error: use of undeclared identifier 'MON_THOUSANDS_SEP'
    case MON_THOUSANDS_SEP:
         ^
lib/nl_langinfo.c:289:10: error: use of undeclared identifier 'MON_GROUPING'
    case MON_GROUPING:
         ^
lib/nl_langinfo.c:291:10: error: use of undeclared identifier 'POSITIVE_SIGN'
    case POSITIVE_SIGN:
         ^
lib/nl_langinfo.c:293:10: error: use of undeclared identifier 'NEGATIVE_SIGN'
    case NEGATIVE_SIGN:
         ^
lib/nl_langinfo.c:295:10: error: use of undeclared identifier 'FRAC_DIGITS'
    case FRAC_DIGITS:
         ^
lib/nl_langinfo.c:297:10: error: use of undeclared identifier 'INT_FRAC_DIGITS'
    case INT_FRAC_DIGITS:
         ^
lib/nl_langinfo.c:299:10: error: use of undeclared identifier 'P_CS_PRECEDES'
    case P_CS_PRECEDES:
         ^
lib/nl_langinfo.c:301:10: error: use of undeclared identifier 'N_CS_PRECEDES'
    case N_CS_PRECEDES:
         ^
lib/nl_langinfo.c:303:10: error: use of undeclared identifier 'P_SEP_BY_SPACE'
    case P_SEP_BY_SPACE:
         ^
lib/nl_langinfo.c:305:10: error: use of undeclared identifier 'N_SEP_BY_SPACE'
    case N_SEP_BY_SPACE:
         ^
lib/nl_langinfo.c:307:10: error: use of undeclared identifier 'P_SIGN_POSN'
    case P_SIGN_POSN:
         ^
lib/nl_langinfo.c:309:10: error: use of undeclared identifier 'N_SIGN_POSN'
    case N_SIGN_POSN:
         ^
16 errors generated.
make[4]: *** [Makefile:9354: lib/nl_langinfo.o] Error 1
make[4]: Leaving directory '/data/data/com.termux/files/home/dgsh_gm/dgsh/unix-tools/coreutils'
make[3]: *** [Makefile:11767: all-recursive] Error 1
make[3]: Leaving directory '/data/data/com.termux/files/home/dgsh_gm/dgsh/unix-tools/coreutils'
make[2]: *** [Makefile:6306: all] Error 2
make[2]: Leaving directory '/data/data/com.termux/files/home/dgsh_gm/dgsh/unix-tools/coreutils'
make[1]: *** [Makefile:90: make] Error 2
make[1]: Leaving directory '/data/data/com.termux/files/home/dgsh_gm/dgsh/unix-tools'
make: *** [Makefile:81: unix-tools] Error 2

@tathastu871
Copy link
Author

tathastu871 commented Nov 22, 2021

Solving some of errors:

  1. releated to mblen:
    add LDFLAGS='-landroid-support -landroid-wordexp'
  2. Some undeclared identifiers:
cd dgsh &&
find . \( -name "freading.c" -o -name  "stdio-impl.h" \) | xargs -I %% sh -c "grep -q \"#include <bits/struct_file.h>\" %%; test \$? -eq 1 && sed \"\$(sed -n '/^#include/=' %% | tail -n1)\"' s/$/\n#include <bits\/struct_file.h>/' %% -i" 
  1. nl_langinfo.c related (Not solved still)
    Package Request:dgsh(Directed Graph Shell) termux/termux-packages#5492 (comment)

@dspinellis
Copy link
Owner

Well done!

@tathastu871
Copy link
Author

Seem it has now ported termux. But after installing dgsh shell binary is not installed.
termux/termux-packages#8702

Build script and patches are at
termux/termux-packages@5579b4f

Please have a look. Help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants