summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-10-09 22:54:48 -0700
committerKaz Kylheku <kaz@kylheku.com>2020-10-09 22:54:48 -0700
commit3d80caccafc27ac812bbf8226eba6d8e529c63ff (patch)
tree22d65fe5bcd9e318237df163af3980c4e5559ba6 /Makefile
parentf4551ed8f9388d7ab79851ea5a42b8a14841130b (diff)
downloadtxr-3d80caccafc27ac812bbf8226eba6d8e529c63ff.tar.gz
txr-3d80caccafc27ac812bbf8226eba6d8e529c63ff.tar.bz2
txr-3d80caccafc27ac812bbf8226eba6d8e529c63ff.zip
configure: replace nm-based trick for sizes
The trick of declaring static arrays whose size is the value of an integer is not working with newer gcc 10 on Cygwin, because that compiler is rearranging the order of the arrays and adding padding. Basically, the writing on the wall is that this is not a good approach. I'm switching to a different approach. By initializing a suitable C structure (which contains character arrays) in a particular way, we can create a .o file in which a shell script is embedded. We can pull out the shell script and evaluate it to get the sizes of types. * Makefile (conftest.syms): Rule removed. (conftest.clean): Don't remove conftest.syms. * configure (conftest_syms, read_syms): Functions removed. (LANG, LC_ALL): New environment variables. This is needed because we are using tr to process a binary file; we can't have it trying to decode multi-byte characters. (mainline): Use new trick for obtaining variables like SIZEOF_INT.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile5
1 files changed, 1 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 2a87512e..dd7a2a11 100644
--- a/Makefile
+++ b/Makefile
@@ -548,9 +548,6 @@ conftest: conftest.c
conftest2: conftest1.c conftest2.c
$(call LINK_PROG,)
-conftest.syms: conftest.o
- $(TXR_NM) -n -t o -P $^ > $@
-
.PHONY: conftest.yacc
conftest.yacc:
$(V)echo $(TXR_YACC)
@@ -573,4 +570,4 @@ conftest.darwin:
conftest.clean:
$(V)rm -f conftest$(EXE) conftest.[co] \
conftest2$(EXE) conftest[12].[oc] \
- conftest.err conftest.syms
+ conftest.err