makelib/config-i686.make
author Jan Vrany <jan.vrany@labware.com>
Mon, 31 Jul 2023 16:32:33 +0100
changeset 339 6582cb445441
parent 303 7276ef940aa3
permissions -rw-r--r--
Specs, get-stx.py: use 'https://dl.vrany.io/public/smalltalkx/devel' as artifact repository

#
# Common definition for i686 arch
#
CPU_INTERN_H=cpu_i386.h
DEFS += -D__amd64_mode32__
CCCONFOPT = -m32

# When performing partial linking, we have to specify `-m elf_i386` in case
# we're compiling 32bit version on otherwise 64bit system - by far the most
# common case these days. If the system is truly 32bit, `-m elf_i386` won't
# hatm.
CLASSLIB_LD=ld -m elf_i386

# We need to use at most GCC 8.x, for yet unknown reason with GCC 9.x and
# newer Smalltalk/X crashes.
#
# Note, that we have to use the trick with `ifeq $(origin CC),...` rather than
# `ifdef` since CC is one of the GNU make implicit variables. series
#
# See https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html
ifeq ($(origin CC),default)
  ifneq ($(shell which gcc-8),)
    CC = gcc-8
  else ifneq ($(shell which gcc-7),)
    CC = gcc-7
  else ifneq ($(shell which gcc-6),)
    CC = gcc-6
  else ifneq ($(shell which gcc-5),)
    CC = gcc-5
  else ifneq ($(shell which gcc-4),)
    CC = gcc-4
  endif
endif