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

build: LDFLAGS are not honored in test build #48

Open
mmitch opened this issue Dec 21, 2020 · 0 comments
Open

build: LDFLAGS are not honored in test build #48

mmitch opened this issue Dec 21, 2020 · 0 comments

Comments

@mmitch
Copy link
Owner

mmitch commented Dec 21, 2020

Currently the tests are disabled for MINGW_32/MINGW64 in configure because activating them gives errors like this:

TEST util.c
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\tmp\ccKTOltY.o:util.c:(.text+0x51): undefined reference to `libintl_fprintf'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\tmp\ccKTOltY.o:util.c:(.text+0x92): undefined reference to `__printf__'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\tmp\ccKTOltY.o:util.c:(.text+0xc1): undefined reference to `__printf__'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\tmp\ccKTOltY.o:util.c:(.text+0xe5): undefined reference to `__printf__'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\tmp\ccKTOltY.o:util.c:(.test+0xb3): undefined reference to `__printf__'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\tmp\ccKTOltY.o:util.c:(.test+0xd3): undefined reference to `__printf__'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\tmp\ccKTOltY.o:util.c:(.test+0xeb): more undefined references to `__printf__' follow
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\tmp\ccKTOltY.o:util.c:(.test+0x153): undefined reference to `libintl_fprintf'
collect2.exe: error: ld returned 1 exit status

The reason seems to be that the LDFLAGS are not honored in the %.test build recipe (which runs the test embedded in util.c):

gbsplay/Makefile

Lines 489 to 493 in 5e83317

%.test: %.c
@echo TEST $<
$(Q)$(HOSTCC) -DENABLE_TEST=1 -o $@$(binsuffix) $< -lm
$(Q)./$@$(binsuffix)
$(Q)rm ./$@$(binsuffix)

Simply adding $(GBSLDFLAGS) and/or $(GBSPLAYLDFLAGS) (plus -fpie and -fpic) does not work: While this will make the build pass under MINGW*, it will break the build on Linux configured with --enable-sharedlibgbs.

Can we have a seperate LDFLAGS for the host-only builds like the %.test and impulse.h targets?
This might also help with issue #47.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant