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

Could not build the source code following instructions in Debian 12. #1810

Open
artshade opened this issue Feb 27, 2024 · 5 comments
Open

Could not build the source code following instructions in Debian 12. #1810

artshade opened this issue Feb 27, 2024 · 5 comments

Comments

@artshade
Copy link

artshade commented Feb 27, 2024

Dear Developers,

Thank you very much for the project!

Environment

$ lsb_release -a
# No LSB modules are available.
# Distributor ID: Debian
# Description:    Debian GNU/Linux 12 (bookworm)
# Release:        12
# Codename:       bookworm

$ uname -a
# Linux host 5.15.0-86-generic #96-Ubuntu SMP Wed Sep 20 08:23:49 UTC 2023 x86_64 GNU/Linux

Case

# cd -- /opt/app;
# git clone --recursive https://github.com/vysheng/tg.git && cd tg;
# sudo apt update;
# sudo apt-get install -y -- libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev libevent-dev libjansson-dev make;
# sudo apt install -y zlib1g-dev;
# ./configure;
user@host:/opt/app/tg$ make
cat tgl/scheme.tl tgl/encrypted_scheme.tl tgl/binlog.tl tgl/append.tl tgl/mtproto.tl > auto/scheme.tl
gcc -I. -I. -I./tgl -g -O2  -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include/lua5.2  -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl/tl-parser -c -MP -MD -MF dep/tl-parser.d -MQ objs/tl-parser.o -o objs/tl-parser.o tgl/tl-parser/tl-parser.c
gcc -I. -I. -I./tgl -g -O2  -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include/lua5.2  -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl/tl-parser -c -MP -MD -MF dep/tlc.d -MQ objs/tlc.o -o objs/tlc.o tgl/tl-parser/tlc.c
gcc objs/tl-parser.o objs/tlc.o -L/usr/local/lib -L/usr/lib -L/usr/lib  -rdynamic -ggdb -levent -ljansson -lconfig -lz -levent   -lreadline -llua5.2  -lm -lssl -lcrypto  -ldl -lpthread -lutil -o bin/tl-parser
bin/tl-parser -e auto/scheme.tlo auto/scheme.tl
gcc -I. -I. -I./tgl -g -O2  -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include/lua5.2  -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/generate.d -MQ objs/generate.o -o objs/generate.o tgl/generate.c
gcc -I. -I. -I./tgl -g -O2  -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include/lua5.2  -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/tools.d -MQ objs/tools.o -o objs/tools.o tgl/tools.c
gcc -I. -I. -I./tgl -g -O2  -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include/lua5.2  -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/crypto/rand_openssl.d -MQ objs/crypto/rand_openssl.o -o objs/crypto/rand_openssl.o tgl/crypto/rand_openssl.c
gcc -I. -I. -I./tgl -g -O2  -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include/lua5.2  -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/crypto/rand_altern.d -MQ objs/crypto/rand_altern.o -o objs/crypto/rand_altern.o tgl/crypto/rand_altern.c
gcc -I. -I. -I./tgl -g -O2  -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include/lua5.2  -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/crypto/err_openssl.d -MQ objs/crypto/err_openssl.o -o objs/crypto/err_openssl.o tgl/crypto/err_openssl.c
gcc -I. -I. -I./tgl -g -O2  -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include/lua5.2  -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/crypto/err_altern.d -MQ objs/crypto/err_altern.o -o objs/crypto/err_altern.o tgl/crypto/err_altern.c
gcc objs/generate.o objs/tools.o objs/crypto/rand_openssl.o objs/crypto/rand_altern.o objs/crypto/err_openssl.o objs/crypto/err_altern.o -L/usr/local/lib -L/usr/lib -L/usr/lib  -rdynamic -ggdb -levent -ljansson -lconfig -lz -levent   -lreadline -llua5.2  -lm -lssl -lcrypto  -ldl -lpthread -lutil -o bin/generate
bin/generate -g skip-header auto/scheme.tlo > auto/auto-skip.h  || ( rm auto/auto-skip.h && false )
bin/generate -g fetch-header auto/scheme.tlo > auto/auto-fetch.h  || ( rm auto/auto-fetch.h && false )
bin/generate -g store-header auto/scheme.tlo > auto/auto-store.h  || ( rm auto/auto-store.h && false )
bin/generate -g autocomplete-header auto/scheme.tlo > auto/auto-autocomplete.h  || ( rm auto/auto-autocomplete.h && false )
bin/generate -g types-header auto/scheme.tlo > auto/auto-types.h  || ( rm auto/auto-types.h && false )
bin/tl-parser -E auto/scheme.tl 2> auto/scheme2.tl  || ( cat auto/scheme2.tl && rm auto/scheme2.tl && false )
awk -f ./tgl/gen_constants_h.awk < auto/scheme2.tl > auto/constants.h
bin/generate -g fetch-ds-header auto/scheme.tlo > auto/auto-fetch-ds.h  || ( rm auto/auto-fetch-ds.h && false )
bin/generate -g free-ds-header auto/scheme.tlo > auto/auto-free-ds.h  || ( rm auto/auto-free-ds.h && false )
bin/generate -g store-ds-header auto/scheme.tlo > auto/auto-store-ds.h  || ( rm auto/auto-store-ds.h && false )
bin/generate -g print-ds-header auto/scheme.tlo > auto/auto-print-ds.h  || ( rm auto/auto-print-ds.h && false )
gcc -I. -I. -I./tgl -g -O2  -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include/lua5.2  -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/main.d -MQ objs/main.o -o objs/main.o main.c
main.c: In function 'termination_signal_handler':
main.c:824:7: error: 'write' reading 18 bytes from a region of size 17 [-Werror=stringop-overread]
  824 |   if (write (1, "SIGNAL received\n", 18) < 0) {
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from main.c:29:
/usr/include/unistd.h:378:16: note: in a call to function 'write' declared with attribute 'access (read_only, 2, 3)'
  378 | extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur
      |                ^~~~~
main.c:824:7: error: 'write' reading 18 bytes from a region of size 17 [-Werror=stringop-overread]
  824 |   if (write (1, "SIGNAL received\n", 18) < 0) {
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/unistd.h:378:16: note: in a call to function 'write' declared with attribute 'access (read_only, 2, 3)'
  378 | extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur
      |                ^~~~~
main.c:824:7: error: 'write' reading 18 bytes from a region of size 17 [-Werror=stringop-overread]
  824 |   if (write (1, "SIGNAL received\n", 18) < 0) {
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/unistd.h:378:16: note: in a call to function 'write' declared with attribute 'access (read_only, 2, 3)'
  378 | extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur
      |                ^~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:48: objs/main.o] Error 1

What might it be?

Best and kind regards

@Paulchen232
Copy link

 try this:

with modified tg/Makefile and deleted -Werror
nano Makefile
./configure
make

Originally posted by @Paulchen232 in #1763 (comment)

@Paulchen232
Copy link

Better no ./configure

@lochhgit
Copy link

lochhgit commented Aug 9, 2024

same proplem
i removed -Werror and then make.

make

gcc -I. -I. -I./tgl -g -O2  -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include/lua5.2  -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/main.d -MQ objs/main.o -o objs/main.o main.c
main.c: In function ‘termination_signal_handler’:
main.c:824:7: error: ‘write’ reading 18 bytes from a region of size 17 [-Werror=stringop-overread]
  824 |   if (write (1, "SIGNAL received\n", 18) < 0) {
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from main.c:29:
/usr/include/unistd.h:378:16: note: in a call to function ‘write’ declared with attribute ‘access (read_only, 2, 3)’
  378 | extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur
      |                ^~~~~
main.c:824:7: error: ‘write’ reading 18 bytes from a region of size 17 [-Werror=stringop-overread]
  824 |   if (write (1, "SIGNAL received\n", 18) < 0) {
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/unistd.h:378:16: note: in a call to function ‘write’ declared with attribute ‘access (read_only, 2, 3)’
  378 | extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur
      |                ^~~~~
main.c:824:7: error: ‘write’ reading 18 bytes from a region of size 17 [-Werror=stringop-overread]
  824 |   if (write (1, "SIGNAL received\n", 18) < 0) {
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/unistd.h:378:16: note: in a call to function ‘write’ declared with attribute ‘access (read_only, 2, 3)’
  378 | extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur
      |                ^~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:48: objs/main.o] Error 1

@artshade
Copy link
Author

artshade commented Aug 9, 2024

same proplem i removed -Werror and then make.

make

gcc -I. -I. -I./tgl -g -O2  -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include/lua5.2  -DHAVE_CONFIG_H -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/main.d -MQ objs/main.o -o objs/main.o main.c
main.c: In function ‘termination_signal_handler’:
main.c:824:7: error: ‘write’ reading 18 bytes from a region of size 17 [-Werror=stringop-overread]
  824 |   if (write (1, "SIGNAL received\n", 18) < 0) {

Have you tried the fork?: https://github.com/kenorb-contrib/tgl

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

4 participants
@Paulchen232 @artshade @lochhgit and others