Discussion:
New compilation errors building Cygwin DLL
Mark Geisert
2018-02-25 00:28:21 UTC
Permalink
I'm getting the following two errors building after a recent 'git pull'...

/oss/src/winsup/cygwin/fhandler_socket_unix.cc: In member function
'virtual int fhandler_socket_unix::ioctl(unsigned int, void*)':
/oss/src/winsup/cygwin/fhandler_socket_unix.cc:589:10: error: 'ret' may be
used uninitialized in this function [-Werror=maybe-uninitialized]
return ret;
^~~
/oss/src/winsup/cygwin/fhandler_socket_unix.cc: In member function
'virtual int fhandler_socket_unix::fcntl(int, intptr_t)':
/oss/src/winsup/cygwin/fhandler_socket_unix.cc:607:10: error: 'ret' may be
used uninitialized in this function [-Werror=maybe-uninitialized]
return ret;
^~~

I'd submit a patch but I'm unsure whether ret needs initialization to 0 or
to -1 (with appropriate set_errno(EBLAH)).

Thanks,

..mark
Corinna Vinschen
2018-02-25 09:44:36 UTC
Permalink
Post by Mark Geisert
I'm getting the following two errors building after a recent 'git pull'...
/oss/src/winsup/cygwin/fhandler_socket_unix.cc: In member function 'virtual
/oss/src/winsup/cygwin/fhandler_socket_unix.cc:589:10: error: 'ret' may be
used uninitialized in this function [-Werror=maybe-uninitialized]
return ret;
^~~
/oss/src/winsup/cygwin/fhandler_socket_unix.cc: In member function 'virtual
/oss/src/winsup/cygwin/fhandler_socket_unix.cc:607:10: error: 'ret' may be
used uninitialized in this function [-Werror=maybe-uninitialized]
return ret;
^~~
I'd submit a patch but I'm unsure whether ret needs initialization to 0 or
to -1 (with appropriate set_errno(EBLAH)).
This is nothing to worry about. It's WIP and the functions have just
been copied from fhandler_socket_local to fhandler_socket_unix and then
stripped down to just keep the stuff required to keep in mind for the
new implemantation. Just ignore any errors from fhandler_socket_unix
for the time being.


Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat
Mark A. Engel
2018-02-26 01:29:38 UTC
Permalink
Hi, I have been trying to build the cross unix/linux compiler and using
the following document;
http://preshing.com/20141119/how-to-build-a-gcc-cross-compiler/
and all is good until I get to step 6 (of the document and I get this
error. I'm not sure where I need to go to fix this error. I have put in

#ifndef RTLD_PRIVATE_ERRNO
#define RTLD_PRIVATE_ERRNO 1
#endif

in the sysdep.h and dl-sysdep.h header files which cleared some of the
undefined rtld_errno but not all. Please help and steer me in the right
direction.

make[2]: Entering directory '/home/MarkEngel/downloads/glibc-2.26/elf'
make -f /home/MarkEngel/downloads/build-glibc/elf/librtld.mk -f
rtld-Rules
make[3]: Entering directory '/home/MarkEngel/downloads/glibc-2.26/elf'
make subdir=dirent -C ../dirent ..=../
objdir=/home/MarkEngel/downloads/build-glibc -f Makefile -f
../elf/rtld-Rules rtld-all rtld-modules='rtld-closedir.os
rtld-readdir.os rtld-rewinddir.os rtld-getdents64.os rtld-fdopendir.os'
make subdir=elf -C ../elf ..=../
objdir=/home/MarkEngel/downloads/build-glibc -f Makefile -f
../elf/rtld-Rules rtld-all rtld-modules='rtld-dl-addr-obj.os'
make subdir=gmon -C ../gmon ..=../
objdir=/home/MarkEngel/downloads/build-glibc -f Makefile -f
../elf/rtld-Rules rtld-all rtld-modules='rtld-profil.os
rtld-prof-freq.os'
make subdir=io -C ../io ..=../
objdir=/home/MarkEngel/downloads/build-glibc -f Makefile -f
../elf/rtld-Rules rtld-all rtld-modules='rtld-xstat.os
rtld-fxstat.os rtld-lxstat.os rtld-open64.os rtld-read.os
rtld-write.os rtld-lseek64.os rtld-access.os rtld-fcntl.os
rtld-close.os'
make[4]: Entering directory '/home/MarkEngel/downloads/glibc-2.26/elf'
make subdir=misc -C ../misc ..=../
objdir=/home/MarkEngel/downloads/build-glibc -f Makefile -f
../elf/rtld-Rules rtld-all rtld-modules='rtld-mmap64.os
rtld-munmap.os rtld-mprotect.os'
make subdir=nptl -C ../nptl ..=../
objdir=/home/MarkEngel/downloads/build-glibc -f Makefile -f
../elf/rtld-Rules rtld-all rtld-modules='rtld-libc-lowlevellock.os
rtld-libc-cancellation.os rtld-libc_multiple_threads.os rtld-forward.os'
make subdir=posix -C ../posix ..=../
objdir=/home/MarkEngel/downloads/build-glibc -f Makefile -f
../elf/rtld-Rules rtld-all rtld-modules='rtld-uname.os rtld-_exit.os
rtld-getpid.os rtld-environ.os'
make[4]: Leaving directory '/home/MarkEngel/downloads/glibc-2.26/elf'
make subdir=setjmp -C ../setjmp ..=../
objdir=/home/MarkEngel/downloads/build-glibc -f Makefile -f
../elf/rtld-Rules rtld-all rtld-modules='rtld-setjmp.os
rtld-__longjmp.os'
make subdir=signal -C ../signal ..=../
objdir=/home/MarkEngel/downloads/build-glibc -f Makefile -f
../elf/rtld-Rules rtld-all rtld-modules='rtld-sigaction.os'
make subdir=stdlib -C ../stdlib ..=../
objdir=/home/MarkEngel/downloads/build-glibc -f Makefile -f
../elf/rtld-Rules rtld-all rtld-modules='rtld-exit.os
rtld-cxa_atexit.os rtld-cxa_thread_atexit_impl.os'
make subdir=string -C ../string ..=../
objdir=/home/MarkEngel/downloads/build-glibc -f Makefile -f
../elf/rtld-Rules rtld-all rtld-modules='rtld-strchr.os
rtld-strcmp.os rtld-strcspn.os rtld-strdup.os rtld-strlen.os
rtld-strnlen.os rtld-memchr.os rtld-memcmp.os rtld-memmove.os
rtld-memset.os rtld-mempcpy.os rtld-stpcpy.os rtld-memcpy.os
rtld-rawmemchr.os rtld-strchrnul.os rtld-memcpy_generic.os
rtld-memcpy_thunderx.os'
make subdir=time -C ../time ..=../
objdir=/home/MarkEngel/downloads/build-glibc -f Makefile -f
../elf/rtld-Rules rtld-all rtld-modules='rtld-setitimer.os'
make[4]: Entering directory '/home/MarkEngel/downloads/glibc-2.26/nptl'
make[4]: Leaving directory '/home/MarkEngel/downloads/glibc-2.26/nptl'
make[3]: Leaving directory '/home/MarkEngel/downloads/glibc-2.26/elf'
aarch64-linux-gcc -nostdlib -nostartfiles -shared -o
/home/MarkEngel/downloads/build-glibc/elf/ld.so.new \
-Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both
-Wl,-z,defs \
/home/MarkEngel/downloads/build-glibc/elf/librtld.os
-Wl,--version-script=/home/MarkEngel/downloads/build-glibc/ld.map \
-Wl,-soname=ld-linux-aarch64.so.1 \
-Wl,-defsym=_begin=0
/home/MarkEngel/downloads/build-glibc/elf/librtld.os: In function
`_dl_map_object_from_fd':
/home/MarkEngel/downloads/glibc-2.26/elf/dl-load.c:890: undefined
reference to `rtld_errno'
/home/MarkEngel/downloads/glibc-2.26/elf/dl-load.c:890: undefined
reference to `rtld_errno'
/home/MarkEngel/downloads/glibc-2.26/elf/dl-load.c:890: undefined
reference to `rtld_errno'
/home/MarkEngel/downloads/glibc-2.26/elf/dl-load.c:890: undefined
reference to `rtld_errno'
/home/MarkEngel/downloads/glibc-2.26/elf/dl-load.c:890: undefined
reference to `rtld_errno'
/home/MarkEngel/downloads/build-glibc/elf/librtld.os:/home/MarkEngel/downloads/glibc-2.26/elf/dl-load.c:890:
more undefined references to `rtld_errno' follow
/home/MarkEngel/downloads/build-glibc/elf/librtld.os: In function
`_dl_sysdep_start':
/home/MarkEngel/downloads/glibc-2.26/elf/../elf/dl-sysdep.c:251:
undefined reference to `__libc_check_standard_fds'
/home/MarkEngel/downloads/build-glibc/elf/librtld.os: In function
`__brk':
/home/MarkEngel/downloads/glibc-2.26/elf/../sysdeps/unix/sysv/linux/generic/brk.c:39:
undefined reference to `rtld_errno'
/home/MarkEngel/downloads/glibc-2.26/elf/../sysdeps/unix/sysv/linux/generic/brk.c:39:
undefined reference to `rtld_errno'
/home/MarkEngel/downloads/build-glibc/elf/librtld.os: In function
`__sbrk':
/home/MarkEngel/downloads/glibc-2.26/elf/../misc/sbrk.c:54:
undefined reference to `rtld_errno'
/home/MarkEngel/downloads/glibc-2.26/elf/../misc/sbrk.c:54:
undefined reference to `rtld_errno'
/home/MarkEngel/downloads/build-glibc/elf/librtld.os: In function
`__getcwd':
/home/MarkEngel/downloads/glibc-2.26/elf/../sysdeps/unix/sysv/linux/getcwd.c:129:
undefined reference to `rtld_errno'
/home/MarkEngel/downloads/build-glibc/elf/librtld.os:/home/MarkEngel/downloads/glibc-2.26/elf/../sysdeps/unix/sysv/linux/getcwd.c:129:
more undefined references to `rtld_errno' follow
/opt/cross/lib/gcc/aarch64-linux/7.2.0/../../../../aarch64-linux/bin/ld:
/home/MarkEngel/downloads/build-glibc/elf/ld.so.new: hidden symbol
`__libc_check_standard_fds' isn't defined
/opt/cross/lib/gcc/aarch64-linux/7.2.0/../../../../aarch64-linux/bin/ld:
final link failed: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:464:
/home/MarkEngel/downloads/build-glibc/elf/ld.so] Error 1
make[2]: Leaving directory '/home/MarkEngel/downloads/glibc-2.26/elf'
make[1]: *** [Makefile:215: elf/subdir_lib] Error 2
make[1]: Leaving directory '/home/MarkEngel/downloads/glibc-2.26'
make: *** [Makefile:9: all] Error 2

Mark ***@Mark-Development ~/downloads/build-glibc
--
Mark Engel
Software Engineer
630 960-5300
***@comcast.net
Mark Geisert
2018-02-26 04:24:09 UTC
Permalink
Hi Mark,
Hi, I have been trying to build the cross unix/linux compiler and using the
following document;
http://preshing.com/20141119/how-to-build-a-gcc-cross-compiler/
and all is good until I get to step 6 (of the document and I get this error.
I'm not sure where I need to go to fix this error. I have put in
#ifndef RTLD_PRIVATE_ERRNO
#define RTLD_PRIVATE_ERRNO 1
#endif
in the sysdep.h and dl-sysdep.h header files which cleared some of the
undefined rtld_errno but not all. Please help and steer me in the right
direction.
make[2]: Entering directory '/home/MarkEngel/downloads/glibc-2.26/elf'
make -f /home/MarkEngel/downloads/build-glibc/elf/librtld.mk -f
rtld-Rules
[...]

What you're doing doesn't seem to have anything to do with building the
Cygwin DLL itself, so this is the wrong mailing list. The web page you
indicated has a comment form at its end. You might use that to reach the
page's author or perhaps one of the responders already quoted who has used
Cygwin to build the cross-compiler.
Good luck,

..mark

Loading...