ad-oliviero / uwufetch

A meme system info tool for Linux, based on nyan/uwu trend on r/linuxmasterrace.
GNU General Public License v3.0
751 stars 49 forks source link

[BUG] uwufetch does not build under Debian (11) - pthread option missing on build #218

Closed jhx0 closed 1 year ago

jhx0 commented 1 year ago

Describe the bug uwufetch fails to build on Debian 11 (amd64) because of missing the -pthread switch (CFLAGS).

To Reproduce Clone the code and run make build.

Expected behavior uwufetch should include the -pthread switch to build successfully.

Screenshots

$ make build
cc -O3 -DUWUFETCH_VERSION=\"2.0-67-g5910f31\" -fPIC -c -o fetch.o fetch.c
ar rcs libfetch.a fetch.o
cc -O3 -DUWUFETCH_VERSION=\"2.0-67-g5910f31\" -shared -o libfetch.so fetch.o
cc -O3 -DUWUFETCH_VERSION=\"2.0-67-g5910f31\" -o uwufetch uwufetch.c libfetch.a
/bin/ld: libfetch.a(fetch.o): in function `get_info':
fetch.c:(.text+0xbf4): undefined reference to `pthread_create'
/bin/ld: fetch.c:(.text+0xe43): undefined reference to `pthread_join'
/bin/ld: fetch.c:(.text+0xe53): undefined reference to `pthread_join'
/bin/ld: fetch.c:(.text+0xe63): undefined reference to `pthread_join'
/bin/ld: fetch.c:(.text+0xe73): undefined reference to `pthread_join'
/bin/ld: fetch.c:(.text+0xe83): undefined reference to `pthread_join'
/bin/ld: libfetch.a(fetch.o):fetch.c:(.text+0xe93): more undefined references to `pthread_join' follow
collect2: error: ld returned 1 exit status
make: *** [Makefile:79: build] Error 1

Desktop (please complete the following information):

Proposed fix: Add -pthread to CFLAGS in Makefile:

Makefile:
...
CFLAGS = -O3 -pthread -DUWUFETCH_VERSION=\"$(UWUFETCH_VERSION)\"
...

$ make build
cc -O3 -pthread -DUWUFETCH_VERSION=\"2.0-67-g5910f31\" -fPIC -c -o fetch.o fetch.c
ar rcs libfetch.a fetch.o
cc -O3 -pthread -DUWUFETCH_VERSION=\"2.0-67-g5910f31\" -shared -o libfetch.so fetch.o
cc -O3 -pthread -DUWUFETCH_VERSION=\"2.0-67-g5910f31\" -o uwufetch uwufetch.c libfetch.a

Thanks in advance!