Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building on Ubuntu 18.04 fails due to wrong shell syntax #8

Open
mingodad opened this issue May 17, 2021 · 2 comments
Open

Building on Ubuntu 18.04 fails due to wrong shell syntax #8

mingodad opened this issue May 17, 2021 · 2 comments
Labels

Comments

@mingodad
Copy link

Trying to build on Ubuntu 18.04 I get this error:

./build_mac_linux.sh
Requirement: gcc 
Linux
compile mini_jvm
../minijvm/c/utils/miniz.c:3031:9: note: #pragma message: Using fopen, ftello, fseeko, stat() etc. path for file I/O - this path may not support large files.
 3031 | #pragma message("Using fopen, ftello, fseeko, stat() etc. path for file I/O - this path may not support large files.")
      |         ^~~~~~~
/tmp/ccEx5qCZ.o: In function `mtx_init':
tinycthread.c:(.text+0x26): undefined reference to `pthread_mutexattr_init'
tinycthread.c:(.text+0x41): undefined reference to `pthread_mutexattr_settype'
tinycthread.c:(.text+0x63): undefined reference to `pthread_mutexattr_destroy'
/tmp/ccEx5qCZ.o: In function `mtx_trylock':
tinycthread.c:(.text+0xeb): undefined reference to `pthread_mutex_trylock'
/tmp/ccEx5qCZ.o: In function `thrd_create':
tinycthread.c:(.text+0x2ea): undefined reference to `pthread_create'
/tmp/ccEx5qCZ.o: In function `thrd_join':
tinycthread.c:(.text+0x3cc): undefined reference to `pthread_join'
/tmp/ccEx5qCZ.o: In function `tss_create':
tinycthread.c:(.text+0x54f): undefined reference to `pthread_key_create'
/tmp/ccEx5qCZ.o: In function `tss_delete':
tinycthread.c:(.text+0x576): undefined reference to `pthread_key_delete'
/tmp/ccEx5qCZ.o: In function `tss_get':
tinycthread.c:(.text+0x58e): undefined reference to `pthread_getspecific'
/tmp/ccEx5qCZ.o: In function `tss_set':
tinycthread.c:(.text+0x5b0): undefined reference to `pthread_setspecific'
/tmp/cc06t1Sw.o: In function `java_lang_Math_exp':
jni_std.c:(.text+0xeb3): undefined reference to `exp'
/tmp/cc06t1Sw.o: In function `java_lang_Math_sin':
jni_std.c:(.text+0xfce): undefined reference to `sin'
/tmp/cc06t1Sw.o: In function `java_lang_Math_cos':
jni_std.c:(.text+0x1036): undefined reference to `cos'
/tmp/cc06t1Sw.o: In function `java_lang_Math_tan':
jni_std.c:(.text+0x109e): undefined reference to `tan'
/tmp/cc06t1Sw.o: In function `java_lang_Math_sqrt':
jni_std.c:(.text+0x1106): undefined reference to `sqrt'
/tmp/cc06t1Sw.o: In function `java_lang_Math_ceil':
jni_std.c:(.text+0x116e): undefined reference to `ceil'
/tmp/cc06t1Sw.o: In function `java_lang_Math_floor':
jni_std.c:(.text+0x11d6): undefined reference to `floor'
/tmp/cc06t1Sw.o: In function `java_lang_Math_asin':
jni_std.c:(.text+0x123e): undefined reference to `asin'
/tmp/cc06t1Sw.o: In function `java_lang_Math_acos':
jni_std.c:(.text+0x12a6): undefined reference to `acos'
/tmp/cc06t1Sw.o: In function `java_lang_Math_atan':
jni_std.c:(.text+0x130e): undefined reference to `atan'
/tmp/cc06t1Sw.o: In function `java_lang_Math_log':
jni_std.c:(.text+0x1376): undefined reference to `log'
/tmp/cc06t1Sw.o: In function `java_lang_Math_atan2':
jni_std.c:(.text+0x1414): undefined reference to `atan2'
/tmp/cc06t1Sw.o: In function `java_lang_Math_pow':
jni_std.c:(.text+0x14a0): undefined reference to `pow'
/tmp/cc06t1Sw.o: In function `java_lang_System_loadLibrary0':
jni_std.c:(.text+0x2545): undefined reference to `dlopen'
jni_std.c:(.text+0x2555): undefined reference to `dlerror'
jni_std.c:(.text+0x2593): undefined reference to `dlsym'
collect2: error: ld returned 1 exit status
compile glfw_gui
mv: cannot stat 'mini_jvm': No such file or directory

Then changing the order of the gcc command allow it to build:

diff build_mac_linux.sh build_mac_linux-dad.sh 
30c30
< ${GCC}  -o mini_jvm -I${CSRC}/jvm -I${CSRC}/utils/ -I${CSRC}/utils/sljit/ -I${CSRC}/utils/https/ -I${CSRC}/utils/https/mbedtls/include/ -lpthread -lm -ldl  $SRCLIST ${CSRC}/utils/sljit/sljitLir.c
---
> ${GCC}  -o mini_jvm -I${CSRC}/jvm -I${CSRC}/utils/ -I${CSRC}/utils/sljit/ -I${CSRC}/utils/https/ -I${CSRC}/utils/https/mbedtls/include/  $SRCLIST ${CSRC}/utils/sljit/sljitLir.c  -lpthread -lm -ldl

Then when trying to build the lib/minijvm_rt.jar I'm getting this error:

./build_jar.sh
Requirement: jdk1.8 jar javac 
./build_jar.sh: 8: ./build_jar.sh: Syntax error: "(" unexpected

Then changing the syntax on build_jar.sh solves it:

diff build_jar.sh build_jar-dad.sh 
1c1
< 
---
> #!/bin/sh
8c8
< function build_jar(){
---
> build_jar(){

Thanks for your great work !

@digitalgust
Copy link
Owner

Let me test it tomorrow

@digitalgust
Copy link
Owner

digitalgust commented May 20, 2021

build scripts issue fixed and test on Ubuntu 18.04. thanks for Domingo Alvarez Duarte

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants