gobo icon indicating copy to clipboard operation
gobo copied to clipboard

Another unsupported compiler

Open ghost opened this issue 3 years ago • 4 comments

Different from the previous: https://github.com/gobo-eiffel/gobo/issues/58

It's Pelles C. See: http://www.smorgasbordet.com/pellesc/

There used to be a request to support Pelles C, but closed: https://github.com/gobo-eiffel/gobo/issues/54

Pelles C is very similar to MSVC. But it's much smaller. So more suitable for people doesn't have plenty of disk space to install MSVC. The generated binaries are still fast, comparable to MSVC.

It seems these bootstrap source files are for MSVC in mind. Even though Pelles C is so similar to MSVC, still not work out of the box.

@ebezault Please support Pelles C.

ghost avatar Oct 15 '22 05:10 ghost

Pelles C has full document about the command line compiler. Install it and check help0009.chm on C:\Program Files\PellesC\Bin\Help

ghost avatar Oct 15 '22 05:10 ghost

This is pocc.cfg:

-- Command lines
cc: pocc /MD /MT /Ze /D_WIN32_WINNT=0x0500 /DWINVER=0x0500 /D_CRT_SECURE_NO_DEPRECATE /D_UNICODE /DUNICODE /DWIN32_LEAN_AND_MEAN $cflags $includes /I%GOBO%\tool\gec\runtime\c $gc_includes /c $c
link: polink /STACK:5000000 /NODEFAULTLIB:libc $lflags_gui $lflags /out:$exe $objs $libs $gc_libs USER32.lib WS2_32.lib ADVAPI32.lib GDI32.lib SHELL32.lib MSIMG32.lib COMDLG32.lib UUID.lib OLE32.lib OLEAUT32.lib COMCTL32.lib MPR.LIB SHLWAPI.LIB WINSPOOL.LIB
rc: porc /r /Fo$res_file $rc_file

-- File extensions
obj: .obj
exe: .exe

-- Variables
#ifdef EIF_WORKBENCH
cflags: /Od /Zi /FS
lflags: /debug
#else
cflags: /O2
lflags:
#endif
#ifdef EIF_CONSOLE
lflags_gui: /subsystem:console
#else
lflags_gui: /subsystem:windows
#endif
#ifdef GE_USE_BOEHM_GC
gc_includes: /I%BOEHM_GC%\include 
gc_libs: %BOEHM_GC%\gc.lib
#else
gc_includes:
gc_libs:
#endif

You could see. Almost no different to msc.cfg

ghost avatar Oct 15 '22 05:10 ghost

This is the hack I put on bootstrap.bat:

...
if .%CC%. == .pocc. goto pocc
...
:pocc
	set CC=pocc
	set LD=polink
	set CFLAGS=/MD /MT /Ze /O2 /std:C99 /Wd2215 /Wd2251
	rem /Wd2030 /Wd2114 /Wd2115 /Wd2154 /Wd2205 /Wd2215 /Wd2238 /Wd2251
	set LFLAGS=/subsystem:console
	set LFLAG_OUT=/out:
	set LLIBS=
	echo pocc > %GOBO%\tool\gec\config\c\default.cfg
	goto pocc_compilation
...
:pocc_compilation
	if not .%VERBOSE%. == .-s. echo Compiling gec (bootstrap 0)...
	%CC% %CFLAGS% /c %BOOTSTRAP_DIR%\gec9.c
	%CC% %CFLAGS% /c %BOOTSTRAP_DIR%\gec8.c
	%CC% %CFLAGS% /c %BOOTSTRAP_DIR%\gec7.c
	%CC% %CFLAGS% /c %BOOTSTRAP_DIR%\gec6.c
	%CC% %CFLAGS% /c %BOOTSTRAP_DIR%\gec5.c
	%CC% %CFLAGS% /c %BOOTSTRAP_DIR%\gec4.c
	%CC% %CFLAGS% /c %BOOTSTRAP_DIR%\gec3.c
	%CC% %CFLAGS% /c %BOOTSTRAP_DIR%\gec2.c
	%CC% %CFLAGS% /c %BOOTSTRAP_DIR%\gec1.c
	%LD% %LFLAGS% %LFLAG_OUT%gec%EXE% gec*%OBJ% %LLIBS%
	%RM% gec*%OBJ%
	goto install
...

ghost avatar Oct 15 '22 05:10 ghost

Still gec9.c, it's the most annoying C source file I have ever tried to compile.

ghost avatar Oct 15 '22 05:10 ghost