You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to compile a sample COBOL hello world program but got an error clang-14: error: no such file or directory: 'z'. Please see the following transcript showing commands and output.
$ cat helo.cob
* Sample COBOL program
IDENTIFICATION DIVISION.
PROGRAM-ID. hello.
PROCEDURE DIVISION.
DISPLAY "Hello, world!".
STOP RUN.
~ $ cobc -x helo.cob --verbose
cobc (GnuCOBOL) 3.1.2.0
Built Jan 02 2022 12:24:38 Packaged Dec 23 2020 12:04:58 UTC
C version "Android (7714059, based on r416183c1) Clang 12.0.8 (https://android.googlesource.com/toolchain/llvm-project c935d99d7cf2016289302412d708641d52d2f7ee)"
loading standard configuration file 'default.conf'
command line: cobc -x --verbose helo.cob
preprocessing: helo.cob -> /data/data/com.termux/files/usr/tmp/cob20281_0.cob
return status: 0
parsing: /data/data/com.termux/files/usr/tmp/cob20281_0.cob (helo.cob)
return status: 0
translating: /data/data/com.termux/files/usr/tmp/cob20281_0.cob -> /data/data/com.termux/files/usr/tmp/cob20281_0.c (helo.cob)
executing: aarch64-linux-android-clang -c -fstack-protector-strong z
-pipe -I/data/data/com.termux/files/usr/include
-I/data/data/com.termux/files/usr/include
-I/data/data/com.termux/files/usr/include -Wno-unused
-fsigned-char -Wno-pointer-sign -Qunused-arguments -o
"/data/data/com.termux/files/usr/tmp/cob20281_0.o"
"/data/data/com.termux/files/usr/tmp/cob20281_0.c"
clang-14: error: no such file or directory: 'z'
return status: 1
I then built Gnucobol 3.1.2 release sources in Termux environment using ./configure --prefix=$HOME/PREFIX && make && make install. I could compile the same source file helo.cob with the cobc binary of this build. The resulting binary helo worked (though it needed some help with LD_LIBRARY_PATH). I'm including terminal transcript for comparison.
Notice that the Termux packages version of cobc adds -fstack-protector-strong z to the arguments of clang. This doesn't happen with cobc binary built by me from source.
I'm hoping this can be fixed by changing something in the Termux build scripts.
What steps will reproduce the bug?
compile helo.cob with command cobc -x helo.cob. command fails with error message: clang-14: error: no such file or directory: 'z'.
Please try gnucobol 3.2.1-1 when it is available shortly. Termux passes -Oz as optimisation level, but it was not recognised by gnucobol's configure script, which tries to remove optimisation levels through various sed patterns
Also note that your locally compiled gnucobol doesn't set RPATH, requiring you to use LD_LIBRARY_PATH. With termux's gnucobol that shouldn't be needed (not to make the program find libcob.so at least)
Problem description
I was trying to compile a sample COBOL hello world program but got an error
clang-14: error: no such file or directory: 'z'
. Please see the following transcript showing commands and output.I then built Gnucobol 3.1.2 release sources in Termux environment using
./configure --prefix=$HOME/PREFIX && make && make install
. I could compile the same source filehelo.cob
with thecobc
binary of this build. The resulting binaryhelo
worked (though it needed some help withLD_LIBRARY_PATH
). I'm including terminal transcript for comparison.Notice that the Termux packages version of
cobc
adds-fstack-protector-strong z
to the arguments ofclang
. This doesn't happen withcobc
binary built by me from source.I'm hoping this can be fixed by changing something in the Termux build scripts.
What steps will reproduce the bug?
compile
helo.cob
with commandcobc -x helo.cob
. command fails with error message:clang-14: error: no such file or directory: 'z'
.Contents of
helo.cob
:What is the expected behavior?
Should produce executable
helo
fromhelo.cob
System information
termux-info:
The text was updated successfully, but these errors were encountered: