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

src/bytecode.c: include config.h to activate guards #145

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

grobian
Copy link

@grobian grobian commented Jan 12, 2022

Fix compilation on Solaris, which needs sys/wait.h for macros like
WEXITSTATUS.

Signed-off-by: Fabian Groffen grobian@gentoo.org

Fix compilation on Solaris, which needs sys/wait.h for macros like
WEXITSTATUS.

Signed-off-by: Fabian Groffen <grobian@gentoo.org>
@grobian
Copy link
Author

grobian commented Jan 12, 2022

without this change:

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../src/aapl -Iinclude -Wall -g -MT bytecode.lo -MD -MP -MF .deps/bytecode.Tpo -c bytecode.c  -fPIC -DPIC -o .libs/bytecode.o
bytecode.c: In function ‘colm_execute_code’:
bytecode.c:3893:30: warning: implicit declaration of function ‘WIFSIGNALED’ [-Wimplicit-function-declaration]
 3893 |                         if ( WIFSIGNALED( res ) )
      |                              ^~~~~~~~~~~
bytecode.c:3894:40: warning: implicit declaration of function ‘WTERMSIG’ [-Wimplicit-function-declaration]
 3894 |                                 raise( WTERMSIG( res ) );
      |                                        ^~~~~~~~
bytecode.c:3895:31: warning: implicit declaration of function ‘WEXITSTATUS’ [-Wimplicit-function-declaration]
 3895 |                         res = WEXITSTATUS( res );
      |                               ^~~~~~~~~~~

...
libtool: link: g++ -Wall "-DINCLUDEDIR=\"/usr/local/include\"" "-DLIBDIR=\"/usr/local/lib\"" "-DABS_TOP_BUILDDIR=\"/net/ptah/export/gentoo/working-repos/colm\"" "-DABS_BUILDDIR=\"/net/ptah/export/gentoo/working-repos/colm/src\"" -DCONS_INIT -Wall -g -o .libs/bootstrap0 bootstrap0-consinit.o bootstrap0-main.o  -L. libprog.a ./.libs/libcolm.so -Wl,-rpath -Wl,/usr/local/lib
/gentoo/prefix64/usr/x86_64-pc-solaris2.11/binutils-bin/2.34/ld: ./.libs/libcolm.so: undefined reference to `WEXITSTATUS'
/gentoo/prefix64/usr/x86_64-pc-solaris2.11/binutils-bin/2.34/ld: ./.libs/libcolm.so: undefined reference to `WIFSIGNALED'
/gentoo/prefix64/usr/x86_64-pc-solaris2.11/binutils-bin/2.34/ld: ./.libs/libcolm.so: undefined reference to `WTERMSIG'
collect2: error: ld returned 1 exit status

This is just the only file that needs config.h's defines, but I guess if autoconf is being used to check for features, that actually all source files should include config.h first thing.

Anyway, I just did this single file, with it, everything compiles and links, resulting in:

% ./src/colm --version Colm version 0.14.7 February 2021
Copyright (c) 2007-2020 by Dr. Adrian D. Thurston

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

Successfully merging this pull request may close these issues.

None yet

1 participant