Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/installer.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Version: "$version"
Platforms: """
windows: i386;amd64
linux: i386;hppa;ia64;alpha;amd64;powerpc64;arm;sparc;sparc64;m68k;mips;mipsel;mips64;mips64el;powerpc;powerpc64el;arm64;riscv32;riscv64
macosx: i386;amd64;powerpc64;arm64
macosx: i386;amd64;powerpc64;powerpc;arm64
solaris: i386;amd64;sparc;sparc64
freebsd: i386;amd64;powerpc64;arm;arm64;riscv64;sparc64;mips;mipsel;mips64;mips64el;powerpc;powerpc64el
netbsd: i386;amd64
Expand Down
4 changes: 2 additions & 2 deletions compiler/platform.nim
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ const
(name: "m68k", intSize: 32, endian: bigEndian, floatSize: 64, bit: 32),
(name: "alpha", intSize: 64, endian: littleEndian, floatSize: 64, bit: 64),
(name: "powerpc", intSize: 32, endian: bigEndian, floatSize: 64, bit: 32),
(name: "powerpc64", intSize: 64, endian: bigEndian, floatSize: 64,bit: 64),
(name: "powerpc64el", intSize: 64, endian: littleEndian, floatSize: 64,bit: 64),
(name: "powerpc64", intSize: 64, endian: bigEndian, floatSize: 64, bit: 64),
(name: "powerpc64el", intSize: 64, endian: littleEndian, floatSize: 64, bit: 64),
(name: "sparc", intSize: 32, endian: bigEndian, floatSize: 64, bit: 32),
(name: "vm", intSize: 32, endian: littleEndian, floatSize: 64, bit: 32),
(name: "hppa", intSize: 32, endian: bigEndian, floatSize: 64, bit: 32),
Expand Down
1 change: 0 additions & 1 deletion config/nim.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ gcc.maxerrorsimpl = "-fmax-errors=3"
@end

@if macosx or freebsd or openbsd:
cc = clang
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this affects the existing OSX and BSD targets!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Araq Thank you for pointing this out! I will fix that. Of course, BSD should not be affected in any way.

Give me few days please, I am just back to Taiwan and building gcc12 across several machines. I will deal with this and csources PR later this week, I hope.

gcc.options.always %= "-w ${gcc.maxerrorsimpl}"
gcc.cpp.options.always %= "-w ${gcc.maxerrorsimpl} -fpermissive"
@elif windows:
Expand Down
27 changes: 25 additions & 2 deletions tools/niminst/buildsh.nimf
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,16 @@ case $uos in
;;
*darwin* )
myos="macosx"
CC="clang"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Araq I assume that for MacOS hardcoding Clang does no good, since for x86 and aarch64 Clang is the default compiler anyway (both in Xcode and Macports, so nothing changes), while for ppc Clang should never be invoked (hardcoding breaks the build).
But if there is a reason to hardcode it, then it must exclude ppc and ppc64.

LINK_FLAGS="$LINK_FLAGS -ldl -lm"
if [ "$HOSTTYPE" = "x86_64" ] ; then
ucpu="amd64"
fi
case $ucpu in
*i386*|*amd64*|*aarch64*|*arm64*)
CC="clang" ;;
*ppc*)
CC="gcc" ;;
esac
;;
*aix* )
myos="aix"
Expand Down Expand Up @@ -188,9 +193,27 @@ case $ucpu in
if [ "$myos" = "linux" ] ; then
COMP_FLAGS="$COMP_FLAGS -m64"
LINK_FLAGS="$LINK_FLAGS -m64"
elif [ "$myos" = "freebsd" ] ; then
COMP_FLAGS="$COMP_FLAGS -m64"
LINK_FLAGS="$LINK_FLAGS -m64"
elif [ "$myos" = "macosx" ] ; then
COMP_FLAGS="$COMP_FLAGS -arch ppc64"
LINK_FLAGS="$LINK_FLAGS -arch ppc64"
fi
mycpu="powerpc64" ;;
*power*|*ppc* )
*ppc )
if [ "$myos" = "linux" ] ; then
COMP_FLAGS="$COMP_FLAGS -m32"
LINK_FLAGS="$LINK_FLAGS -m32"
elif [ "$myos" = "freebsd" ] ; then
COMP_FLAGS="$COMP_FLAGS -m32"
LINK_FLAGS="$LINK_FLAGS -m32"
elif [ "$myos" = "macosx" ] ; then
COMP_FLAGS="$COMP_FLAGS -arch ppc"
LINK_FLAGS="$LINK_FLAGS -arch ppc"
fi
mycpu="powerpc" ;;
*power* )
if [ "$myos" = "freebsd" ] ; then
if [ "$ucpu" != "powerpc" ] ; then
COMP_FLAGS="$COMP_FLAGS -m64"
Expand Down
33 changes: 31 additions & 2 deletions tools/niminst/makefile.nimf
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,28 @@ ifeq ($(uos),netbsd)
endif
ifeq ($(uos),darwin)
myos = macosx
CC = clang
LDFLAGS += -ldl -lm
ifeq ($(HOSTTYPE),x86_64)
ucpu = amd64
endif
ifeq ($(ucpu),i386)
CC = clang
endif
ifeq ($(ucpu),amd64)
CC = clang
endif
ifeq ($(ucpu),arm64)
CC = clang
endif
ifeq ($(ucpu),aarch64)
CC = clang
endif
ifeq ($(ucpu),ppc)
CC = gcc
endif
ifeq ($(ucpu),ppc64)
CC = gcc
endif
endif
ifeq ($(uos),aix)
myos = aix
Expand Down Expand Up @@ -118,6 +135,14 @@ ifeq ($(ucpu),ppc64)
CFLAGS += -m64
LDFLAGS += -m64
endif
ifeq ($(myos),freebsd)
CFLAGS += -m64
LDFLAGS += -m64
endif
ifeq ($(myos),macosx)
CFLAGS += -arch ppc64
LDFLAGS += -arch ppc64
endif
endif
ifeq ($(ucpu),powerpc)
mycpu = powerpc
Expand All @@ -131,7 +156,11 @@ ifeq ($(ucpu),powerpc)
endif
endif
ifeq ($(ucpu),ppc)
mycpu = ppc
mycpu = powerpc
ifeq ($(myos),macosx)
CFLAGS += -arch ppc
LDFLAGS += -arch ppc
endif
endif
ifneq (,$(filter $(ucpu), mips mips64))
mycpu = $(shell /bin/sh -c '"$(CC)" -dumpmachine | sed "s/-.*//"')
Expand Down