vishapoberon / compiler

vishap oberon compiler
http://oberon.vishap.am
GNU General Public License v3.0
186 stars 25 forks source link

clang: error: no such file or directory: 'Oberon/voc/voc' #75

Closed jkleiser closed 4 years ago

jkleiser commented 4 years ago

I just cloned the https://github.com/vishaps/voc on my Mac (macOS 10.14.6, Mojave), and when I do make full, I get this:

Configuration: 2.1.0 [2019/11/03] for clang LP64 on darwin
Branch: master.

--- Cleaning branch master darwin clang LP64 ---

--- Compiler build started ---

Populating clean build directory from bootstrap C sources unix-88.

make assemble - compiling Oberon compiler c source:
  VERSION: 2.1.0
  BRANCH:  master
  Target characteristics:
    PLATFORM:   unix
    OS:         darwin
    BUILDDIR:   build/darwin.LP64.clang
    INSTALLDIR: /opt/voc
  Oberon characteristics:
    MODEL:      2
    ADRSIZE:    8
    ALIGNMENT:  8
  C compiler:
    COMPILER:   clang
    COMPILE:    clang -fPIC -g
    DATAMODEL:  LP64
Files.c:856:26: warning: passing 'CHAR *' (aka 'unsigned char *') to parameter of type 'SYSTEM_BYTE *'
      (aka 'signed char *') converts between pointers to integer types with different sign
      [-Wpointer-sign]
        Files_Read(&*R, R__typ, (CHAR*)(void*)&*x);
                                ^~~~~~~~~~~~~~~~~
Files.c:612:64: note: passing argument to parameter 'x' here
void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x)
                                                               ^
1 warning generated.
clang: error: no such file or directory: 'Oberon/voc/voc'
make[2]: *** [src/tools/make/oberon.mk:66: assemble] Error 1
make[1]: *** [src/tools/make/oberon.mk:87: compilerfromsavedsource] Error 2
make: *** [makefile:139: full] Error 2

What may be the reason?

dcwbrown commented 4 years ago

No progress yet I'm afraid.

I have been unable to reproduce this on my 10.11.6 Mac OS X.

Line 66 is

cd $(BUILDDIR) && $(COMPILE) -c OPC.c OPV.c OPB.c OPP.c

and I don't understand how it could generate the error message

clang: error: no such file or directory: 'Oberon/voc/voc'

Because:

  1. I pass absolute paths to file and directory parameters and Oberon/voc/voc is a relative path.
  2. Oberon/voc/voc is the name of the post-link compiler executable binary, and my make script doesn't mentioned that until line 68.
  3. If I pass this relative compiler binary path to the compiler on line 68 I get a different error message.

I'm still thinking.

norayr commented 4 years ago

i guess, that's because make on osx is not gnu make.

try to do gmake full.

jkleiser commented 4 years ago

Sorry, I cannot see any difference:

$ gmake clean
Configuration: 2.1.0 [2019/11/04] for clang LP64 on darwin
Branch: master.

--- Cleaning branch master darwin clang LP64 ---

$ gmake full
Configuration: 2.1.0 [2019/11/04] for clang LP64 on darwin
Branch: master.

--- Cleaning branch master darwin clang LP64 ---

--- Compiler build started ---

Populating clean build directory from bootstrap C sources unix-88.

make assemble - compiling Oberon compiler c source:
  VERSION: 2.1.0
  BRANCH:  master
  Target characteristics:
    PLATFORM:   unix
    OS:         darwin
    BUILDDIR:   build/darwin.LP64.clang
    INSTALLDIR: /opt/voc
  Oberon characteristics:
    MODEL:      2
    ADRSIZE:    8
    ALIGNMENT:  8
  C compiler:
    COMPILER:   clang
    COMPILE:    clang -fPIC -g
    DATAMODEL:  LP64
Files.c:856:26: warning: passing 'CHAR *' (aka 'unsigned char *') to parameter of type 'SYSTEM_BYTE *'
      (aka 'signed char *') converts between pointers to integer types with different sign
      [-Wpointer-sign]
        Files_Read(&*R, R__typ, (CHAR*)(void*)&*x);
                                ^~~~~~~~~~~~~~~~~
Files.c:612:64: note: passing argument to parameter 'x' here
void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x)
                                                               ^
1 warning generated.
clang: error: no such file or directory: 'Oberon/voc/voc'
make[2]: *** [src/tools/make/oberon.mk:66: assemble] Error 1
make[1]: *** [src/tools/make/oberon.mk:87: compilerfromsavedsource] Error 2
gmake: *** [makefile:139: full] Error 2
dcwbrown commented 4 years ago

Yes, BSD make is supported. My automatic regression tests on FreeBSD and OpenBSD all use BSD make. (It turns out that Apple's dev environment uses GNU make.)

I have updated my Apple - a 2011 iMac - as far as possible, which is to 10.13.6 High Sierra. It still builds fine for me.

Please would you run

make SHELL='/bin/bash -x' full

and we will see exactly which command fails and what parameters it was passed. Thanks!

jkleiser commented 4 years ago
$ make SHELL='/bin/bash -x' full
+ cc -I src/runtime -o a.o src/tools/make/configure.c
+ ./a.o
Configuration: 2.1.0 [2019/11/04] for clang LP64 on darwin
+ rm a.o
++ git rev-parse --abbrev-ref HEAD
+ echo BRANCH=master
++ git rev-parse --abbrev-ref HEAD
+ echo Branch: master.
Branch: master.
+ make -f src/tools/make/oberon.mk -s clean
+ printf '\n\n--- Cleaning branch master darwin clang LP64 ---\n\n'

--- Cleaning branch master darwin clang LP64 ---

+ rm -rf build/darwin.LP64.clang /Volumes/P3/Ѵishap Oberon/voc/install
+ rm -f voc
+ printf '\n\n--- Compiler build started ---\n\n'

--- Compiler build started ---

+ make -f src/tools/make/oberon.mk -s compilerfromsavedsource MODEL=2
+ echo Populating clean build directory from bootstrap C sources unix-88.
Populating clean build directory from bootstrap C sources unix-88.
+ mkdir -p build/darwin.LP64.clang
+ cp bootstrap/unix-88/Compiler.c bootstrap/unix-88/Configuration.c bootstrap/unix-88/Configuration.h bootstrap/unix-88/Files.c bootstrap/unix-88/Files.h bootstrap/unix-88/Heap.c bootstrap/unix-88/Heap.h bootstrap/unix-88/Modules.c bootstrap/unix-88/Modules.h bootstrap/unix-88/OPB.c bootstrap/unix-88/OPB.h bootstrap/unix-88/OPC.c bootstrap/unix-88/OPC.h bootstrap/unix-88/OPM.c bootstrap/unix-88/OPM.h bootstrap/unix-88/OPP.c bootstrap/unix-88/OPP.h bootstrap/unix-88/OPS.c bootstrap/unix-88/OPS.h bootstrap/unix-88/OPT.c bootstrap/unix-88/OPT.h bootstrap/unix-88/OPV.c bootstrap/unix-88/OPV.h bootstrap/unix-88/Out.c bootstrap/unix-88/Out.h bootstrap/unix-88/Platform.c bootstrap/unix-88/Platform.h bootstrap/unix-88/Reals.c bootstrap/unix-88/Reals.h bootstrap/unix-88/Strings.c bootstrap/unix-88/Strings.h bootstrap/unix-88/Texts.c bootstrap/unix-88/Texts.h bootstrap/unix-88/VT100.c bootstrap/unix-88/VT100.h bootstrap/unix-88/extTools.c bootstrap/unix-88/extTools.h build/darwin.LP64.clang
+ cp bootstrap/SYSTEM.c bootstrap/SYSTEM.h bootstrap/WindowsWrapper.h build/darwin.LP64.clang
+ make -f src/tools/make/oberon.mk -s assemble
+ printf '\nmake assemble - compiling Oberon compiler c source:\n'

make assemble - compiling Oberon compiler c source:
+ printf '  VERSION: %s\n' 2.1.0
  VERSION: 2.1.0
+ printf '  BRANCH:  %s\n' master
  BRANCH:  master
+ printf '  Target characteristics:\n'
  Target characteristics:
+ printf '    PLATFORM:   %s\n' unix
    PLATFORM:   unix
+ printf '    OS:         %s\n' darwin
    OS:         darwin
+ printf '    BUILDDIR:   %s\n' build/darwin.LP64.clang
    BUILDDIR:   build/darwin.LP64.clang
+ printf '    INSTALLDIR: %s\n' /opt/voc
    INSTALLDIR: /opt/voc
+ printf '  Oberon characteristics:\n'
  Oberon characteristics:
+ printf '    MODEL:      %s\n' 2
    MODEL:      2
+ printf '    ADRSIZE:    %s\n' 8
    ADRSIZE:    8
+ printf '    ALIGNMENT:  %s\n' 8
    ALIGNMENT:  8
+ printf '  C compiler:\n'
  C compiler:
+ printf '    COMPILER:   %s\n' clang
    COMPILER:   clang
+ printf '    COMPILE:    %s\n' 'clang -fPIC -g'
    COMPILE:    clang -fPIC -g
+ printf '    DATAMODEL:  %s\n' LP64
    DATAMODEL:  LP64
+ cd build/darwin.LP64.clang
+ clang -fPIC -g -c SYSTEM.c Configuration.c Platform.c Heap.c
+ cd build/darwin.LP64.clang
+ clang -fPIC -g -c Out.c Reals.c Strings.c Modules.c
+ cd build/darwin.LP64.clang
+ clang -fPIC -g -c Files.c Texts.c VT100.c
Files.c:856:26: warning: passing 'CHAR *' (aka 'unsigned char *') to parameter of type 'SYSTEM_BYTE *'
      (aka 'signed char *') converts between pointers to integer types with different sign
      [-Wpointer-sign]
        Files_Read(&*R, R__typ, (CHAR*)(void*)&*x);
                                ^~~~~~~~~~~~~~~~~
Files.c:612:64: note: passing argument to parameter 'x' here
void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x)
                                                               ^
1 warning generated.
+ cd build/darwin.LP64.clang
+ clang -fPIC -g -c OPM.c extTools.c OPS.c OPT.c
+ cd build/darwin.LP64.clang
+ clang -fPIC -g -c OPC.c OPV.c OPB.c OPP.c
+ cd build/darwin.LP64.clang
+ clang -fPIC -g Compiler.c -o /Volumes/P3/Ѵishap Oberon/voc/voc SYSTEM.o Configuration.o Platform.o Heap.o Out.o Strings.o Modules.o Files.o Reals.o Texts.o VT100.o extTools.o OPM.o OPS.o OPT.o OPC.o OPV.o OPB.o OPP.o
clang: error: no such file or directory: 'Oberon/voc/voc'
make[2]: *** [src/tools/make/oberon.mk:66: assemble] Error 1
make[1]: *** [src/tools/make/oberon.mk:87: compilerfromsavedsource] Error 2
make: *** [makefile:139: full] Error 2
dcwbrown commented 4 years ago

Thanks! Ah ha!

My makefile is not allowing for the space in your directory name 'Vishap Oberon'.

Please would you rename the directory without a space and try again?

I'll look into supporting spaces in directory names - I don't see why we shouldn't be able to support that.

-- Dave.

jkleiser commented 4 years ago

Thanks! It looks promising now:

--- Confidence tests passed ---

Oberon build and test complete, result is in /Volumes/P3/Vishap_Oberon/voc/install

You can use the new compiler by running /Volumes/P3/Vishap_Oberon/voc/install/bin/voc,
Or add it to your path as follows:
export PATH="/Volumes/P3/Vishap_Oberon/voc/install/bin:$PATH"
jkleiser commented 4 years ago

It also builds fine on macOS 10.15, Catalina.