error during compile on RHEL6 eval: line 1736: syntax error near unexpected token `|'

Dennis Clarke dclarke at blastwave.org
Sun Jun 12 04:13:20 CEST 2022


* * * duplicate of https://github.com/libssh2/libssh2/issues/709 * * *

This seems very familiar but I can not recall the little patch to get
around it.

This is on an old Red Hat Enterprise Linux 6 machine but with a pile of
new stuff already built, tested and installed into /opt/bw and that
includes OpenSSL 3.0.3 which resides in /opt/bw/ssl.


Configure seems perfectly fine :

mimas$ uname -a
Linux mimas.genunix.com 4.9.316-genunix #1 SMP Thu May 26 03:10:12 EDT 
2022 x86_64 x86_64 x86_64 GNU/Linux
mimas$ ./configure --prefix=/opt/bw --disable-silent-rules \
 > --enable-dependency-tracking --enable-shared --enable-static \
 > --enable-debug --disable-hidden-symbols \
 > --with-gnu-ld --with-crypto=openssl \
 > --with-libssl-prefix=/opt/bw/ssl --with-libz-prefix=/opt/bw
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports nested variables... yes
checking for sed... /bin/sed
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking libssh2 version... 1.10.0
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
configure: autobuild project... libssh2
configure: autobuild revision... 1.10.0
configure: autobuild hostname... mimas.genunix.com
configure: autobuild timestamp... 20220612-013552
checking whether make supports the include directive... yes (GNU style)
checking for gcc... /opt/bw/gcc12/bin/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... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether /opt/bw/gcc12/bin/gcc accepts -g... yes
checking for /opt/bw/gcc12/bin/gcc option to enable C11 features... 
unsupported
checking for /opt/bw/gcc12/bin/gcc option to enable C99 features... none 
needed
checking whether /opt/bw/gcc12/bin/gcc understands -c and -o together... yes
checking dependency style of /opt/bw/gcc12/bin/gcc... gcc3
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for long long... yes
checking if _REENTRANT is already defined... no
checking if _REENTRANT is actually needed... no
checking if _REENTRANT is onwards defined... no
checking for library containing socket... none required
checking for library containing inet_addr... none required
checking for gcc... (cached) /opt/bw/gcc12/bin/gcc
checking whether the compiler supports GNU C... (cached) yes
checking whether /opt/bw/gcc12/bin/gcc accepts -g... (cached) yes
checking for /opt/bw/gcc12/bin/gcc option to enable C11 features... 
(cached) unsupported
checking for /opt/bw/gcc12/bin/gcc option to enable C99 features... 
(cached) none needed
checking whether /opt/bw/gcc12/bin/gcc understands -c and -o together... 
(cached) yes
checking dependency style of /opt/bw/gcc12/bin/gcc... (cached) gcc3
checking whether the compiler supports GNU C++... yes
checking whether /opt/bw/gcc12/bin/g++ accepts -g... yes
checking for /opt/bw/gcc12/bin/g++ option to enable C++11 features... 
none needed
checking dependency style of /opt/bw/gcc12/bin/g++... gcc3
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking for sshd... /usr/sbin/sshd
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by /opt/bw/gcc12/bin/gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm
checking the name lister (/usr/bin/nm) interface... BSD nm
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to 
x86_64-pc-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 /usr/bin/ld option to reload object files... -r
checking for objdump... /usr/bin/objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... dlltool
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... @
checking for strip... /usr/bin/strip
checking for ranlib... /usr/bin/ranlib
checking command to parse /usr/bin/nm output from /opt/bw/gcc12/bin/gcc 
object... failed
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if /opt/bw/gcc12/bin/gcc supports -fno-rtti -fno-exceptions... no
checking for /opt/bw/gcc12/bin/gcc option to produce PIC... -fPIC -DPIC
checking if /opt/bw/gcc12/bin/gcc PIC flag -fPIC -DPIC works... yes
checking if /opt/bw/gcc12/bin/gcc static flag -static works... no
checking if /opt/bw/gcc12/bin/gcc supports -c -o file.o... yes
checking if /opt/bw/gcc12/bin/gcc supports -c -o file.o... (cached) yes
checking whether the /opt/bw/gcc12/bin/gcc linker (/usr/bin/ld -m 
elf_x86_64) 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 how to run the C++ preprocessor... /opt/bw/gcc12/bin/g++ -E
checking for ld used by /opt/bw/gcc12/bin/g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the /opt/bw/gcc12/bin/g++ linker (/usr/bin/ld -m 
elf_x86_64) supports shared libraries... yes
checking for /opt/bw/gcc12/bin/g++ option to produce PIC... -fPIC -DPIC
checking if /opt/bw/gcc12/bin/g++ PIC flag -fPIC -DPIC works... yes
checking if /opt/bw/gcc12/bin/g++ static flag -static works... no
checking if /opt/bw/gcc12/bin/g++ supports -c -o file.o... yes
checking if /opt/bw/gcc12/bin/g++ supports -c -o file.o... (cached) yes
checking whether the /opt/bw/gcc12/bin/g++ linker (/usr/bin/ld -m 
elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether byte ordering is bigendian... no
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for ld used by GCC... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking for shared library run path origin... done
checking for libssl... yes
checking how to link with libssl... -lssl -lcrypto
checking for EVP_aes_128_ctr... no
checking for /opt/bw/gcc12/bin/gcc options needed to detect all 
undeclared functions... none needed
checking for libz... yes
checking how to link with libz... -lz
configure: WARNING: secure clearing/zeroing of memory is not supported 
by the selected crypto backend
checking whether to enable pedantic and debug compiler options... 
checking how to run the C preprocessor... /opt/bw/gcc12/bin/gcc -E
yes
checking for icc in use... no
checking gcc version... 12.1.0
configure: Added this set of compiler options: -W -Wall -Wwrite-strings 
-pedantic -Wpointer-arith -Wnested-externs -Winline -Wmissing-prototypes 
-Wmissing-declarations -Wundef -Wno-long-long -Wsign-compare 
-Wfloat-equal -Wno-format-nonliteral -Wendif-labels -Wstrict-prototypes 
-Wdeclaration-after-statement -isystem /opt/bw/include -isystem 
/opt/bw/ssl/include -isystem /opt/bw/include
checking whether to enable hidden symbols in the library... no
checking whether to build example applications... yes
checking for errno.h... yes
checking for fcntl.h... yes
checking for stdio.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/uio.h... yes
checking for sys/select.h... yes
checking for sys/socket.h... yes
checking for sys/ioctl.h... yes
checking for sys/time.h... yes
checking for arpa/inet.h... yes
checking for netinet/in.h... yes
checking for sys/un.h... yes
checking for windows.h... no
checking for winsock2.h... no
checking for ws2tcpip.h... no
checking for poll... yes
checking for gettimeofday... yes
checking for select... yes
checking for strtoll... yes
checking for memset_s... no
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking non-blocking sockets style... O_NONBLOCK
checking whether to enable compiler warnings as errors... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating tests/Makefile
config.status: creating tests/ossfuzz/Makefile
config.status: creating example/Makefile
config.status: creating docs/Makefile
config.status: creating libssh2.pc
config.status: creating src/libssh2_config.h
config.status: executing depfiles commands
config.status: executing libtool commands
configure: summary of build options:

   version:          1.10.0
   Host type:        x86_64-pc-linux-gnu
   Install prefix:   /opt/bw
   Compiler:         /opt/bw/gcc12/bin/gcc
   Compiler flags:    -std=iso9899:1999 -pedantic -pedantic-errors 
-fno-builtin -g -m64 -march=k8 -mtune=k8 -malign-double -mpc80 -mno-mmx 
-Wl,-rpath=/opt/bw/lib,--enable-new-dtags 
-Wl,-rpath=/opt/bw/ssl/lib64,--enable-new-dtags -g -W -Wall 
-Wwrite-strings -pedantic -Wpointer-arith -Wnested-externs -Winline 
-Wmissing-prototypes -Wmissing-declarations -Wundef -Wno-long-long 
-Wsign-compare -Wfloat-equal -Wno-format-nonliteral -Wendif-labels 
-Wstrict-prototypes -Wdeclaration-after-statement -isystem 
/opt/bw/include -isystem /opt/bw/ssl/include -isystem /opt/bw/include
   Library types:    Shared=yes, Static=yes
   Crypto library:   OpenSSL (AES-CTR: no)
   Clear memory:     unsupported
   Debug build:      yes
   Build examples:   yes
   Path to sshd:     /usr/sbin/sshd (only for self-tests)
   zlib compression: yes


I do have some CFLAGS set as well as LD stuff for the runpath etc :

ADDR2LINE=/usr/bin/addr2line
AR=/usr/bin/ar
AS=/usr/bin/as
BISON=/opt/bw/bin/bison
CC=/opt/bw/gcc12/bin/gcc
CFLAGS=-std=iso9899:1999 -pedantic -pedantic-errors -fno-builtin -g -O0 
-m64 -march=k8 -mtune=k8 -malign-double -mpc80 -mno-mmx 
-Wl,-rpath=/opt/bw/lib,--enable-new-dtags 
-Wl,-rpath=/opt/bw/ssl/lib64,--enable-new-dtags
CPPFLAGS=-I/opt/bw/include -I/opt/bw/ssl/include 
-D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
CXXFLAGS=-std=c++11 -fno-builtin -g -O0 -m64 -march=k8 -mtune=k8 
-malign-double -mpc80 -mno-mmx -Wl,-rpath=/opt/bw/lib,--enable-new-dtags 
-Wl,-rpath=/opt/bw/ssl/lib64,--enable-new-dtags
CXX=/opt/bw/gcc12/bin/g++
EDITOR=/bin/vi
ELFEDIT=/usr/bin/elfedit
GPROF=/usr/bin/gprof
HOME=/home/dclarke
HOSTNAME=mimas.genunix.com
LANG=en_US.UTF-8
LC_COLLATE=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
LC_MESSAGES=en_US.UTF-8
LC_MONETARY=en_US.UTF-8
LC_NUMERIC=en_US.UTF-8
LC_TIME=en_US.UTF-8
LD_RUN_PATH=/opt/bw/lib:/opt/bw/ssl/lib64
LD=/usr/bin/ld
LESS_IS_MORE=1
LOGNAME=dclarke
M4=/opt/bw/bin/m4
MAIL=/var/spool/mail/dclarke
NM=/usr/bin/nm
OBJCOPY=/usr/bin/objcopy
OBJDUMP=/usr/bin/objdump
OLDPWD=/opt/bw/build
PAGER=/bin/more
PATH=/opt/bw/gcc12/bin:/opt/bw/bin:/opt/bw/sbin:/opt/bw/ssl/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin
PERL=/opt/bw/bin/perl
PWD=/opt/bw/build/libssh2-1.10.0_rhel6_amd64.001
PYTHON=/opt/bw/bin/python3
RANLIB=/usr/bin/ranlib
READELF=/usr/bin/readelf
SHELL=/bin/bash
SHLVL=2
SIZE=/usr/bin/size
STRINGS=/usr/bin/strings
STRIP=/usr/bin/strip
TERM_PROGRAM=tmux
TERM_PROGRAM_VERSION=3.2a
TERM=xterm
TIME=/usr/bin/time
TMPDIR=/var/tmp/dclarke
TMUX_PANE=%1
TMUX=/var/tmp/dclarke/default,2891,0
TZ=GMT0
USER=dclarke
VISUAL=/bin/vi
XTERM_LOCALE=en_US.UTF-8
XTERM_SHELL=/bin/bash
YACC=/opt/bw/bin/yacc

Very likely the LD_RUN_PATH is not needed given the -Wl flags but it
should be harmless.

The compile fails eventually :
.
.
.
/bin/sh ../libtool  --tag=CC   --mode=link /opt/bw/gcc12/bin/gcc 
-std=iso9899:1999 -pedantic -pedantic-errors -fno-builtin -g -m64 
-march=k8 -mtune=k8 -malign-double -mpc80 -mno-mmx 
-Wl,-rpath=/opt/bw/lib,--enable-new-dtags 
-Wl,-rpath=/opt/bw/ssl/lib64,--enable-new-dtags -g -W -Wall 
-Wwrite-strings -pedantic -Wpointer-arith -Wnested-externs -Winline 
-Wmissing-prototypes -Wmissing-declarations -Wundef -Wno-long-long 
-Wsign-compare -Wfloat-equal -Wno-format-nonliteral -Wendif-labels 
-Wstrict-prototypes -Wdeclaration-after-statement -isystem 
/opt/bw/include -isystem /opt/bw/ssl/include -isystem /opt/bw/include 
-version-info 1:1:0 -no-undefined -export-symbols-regex '^libssh2_.*' 
-lssl -lcrypto -lz  -o libssh2.la -rpath /opt/bw/lib channel.lo comp.lo 
crypt.lo hostkey.lo kex.lo mac.lo misc.lo packet.lo publickey.lo scp.lo 
session.lo sftp.lo userauth.lo transport.lo version.lo knownhost.lo 
agent.lo openssl.lo pem.lo keepalive.lo global.lo blowfish.lo 
bcrypt_pbkdf.lo agent_win.lo
libtool: link: /usr/bin/nm  .libs/channel.o .libs/comp.o .libs/crypt.o 
.libs/hostkey.o .libs/kex.o .libs/mac.o .libs/misc.o .libs/packet.o 
.libs/publickey.o .libs/scp.o .libs/session.o .libs/sftp.o 
.libs/userauth.o .libs/transport.o .libs/version.o .libs/knownhost.o 
.libs/agent.o .libs/openssl.o .libs/pem.o .libs/keepalive.o 
.libs/global.o .libs/blowfish.o .libs/bcrypt_pbkdf.o .libs/agent_win.o 
  |  | /bin/sed 's/.* //' | sort | uniq > .libs/libssh2.exp
../libtool: eval: line 1736: syntax error near unexpected token `|'
../libtool: eval: line 1736: `/usr/bin/nm  .libs/channel.o .libs/comp.o 
.libs/crypt.o .libs/hostkey.o .libs/kex.o .libs/mac.o .libs/misc.o 
.libs/packet.o .libs/publickey.o .libs/scp.o .libs/session.o 
.libs/sftp.o .libs/userauth.o .libs/transport.o .libs/version.o 
.libs/knownhost.o .libs/agent.o .libs/openssl.o .libs/pem.o 
.libs/keepalive.o .libs/global.o .libs/blowfish.o .libs/bcrypt_pbkdf.o 
.libs/agent_win.o   |  | /bin/sed 's/.* //' | sort | uniq > 
.libs/libssh2.exp'
../libtool: line 1736: warning: syntax errors in . or eval will cause 
future versions of the shell to abort as Posix requires
make[2]: *** [libssh2.la] Error 1
make[2]: Leaving directory 
`/opt/bw/build/libssh2-1.10.0_rhel6_amd64.001/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory 
`/opt/bw/build/libssh2-1.10.0_rhel6_amd64.001/src'
make: *** [all-recursive] Error 1

So there seems to be a script file somewhere with a slight bug in it.

-- 
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
GreyBeard and suspenders optional


More information about the libssh2-devel mailing list