Conversation
| # copy | ||
| mkdir -p /home/lind/lind-wasm/lindfs/usr/local/lib/tcc/ | ||
| cp tcc.cwasm ../lindfs/ | ||
| cp libtcc1.a /home/lind/lind-wasm/lindfs/usr/local/lib/tcc/ |
There was a problem hiding this comment.
libtcc1.a is not statically compiled with tinycc and is copied to lib/ folder. This is a static build of tinycc right. In that case I suppose, you need to pass libtcc as a dependent library (ldflags) during compilation phase. Essentially we need to have compilation of libtcc1 under 'merge-sysroot' in the main Makefile of the app and the built library should be placed under sysroot_merged folder and have ldflags have syroot_merged folder in its arguments (-I) like this.
lind-wasm-apps/curl/compile_curl.sh
Line 73 in 39b15e4
@rennergade @qianxichen233 Could you pls confirm this?
There was a problem hiding this comment.
Sysroot is used by clang to compile wasm binary. libtcc1.a is not used by clang. It's used by tcc during compiling the native code, so it should be placed in lindfs not sysroot.
|
@qianxichen233 @rennergade Could you please review this? |
|
|
||
| # libtcc.a is a shared library that is required to run tinycc. Since the target is i386, libtcc.a is also compiled as i386. | ||
|
|
||
| # The required header files, shared libraries and other files (libc.so, ld.so, libc_nonshared.a, crt1.o) which are required to run tinycc is also copied to the build/ folder. |
There was a problem hiding this comment.
Not required to "run tcc" but to compile correct native binary that can be run on native
…ion and copying to build folder of app repo
…nycc to the build folder
ed12508 to
2ae38d4
Compare
Resolves #91
Added build script required to compile tinycc for lind-wasm.
The compiled tinycc compiler can compile C programs to 32-bit ELF binaries (i386 target)
Since the target is i386, the dependent library
libtcc.ais compiled using as a i386 shared folder using gcc. Also, in order to run tinycc, the following are required:libc.so.6,ld.so,libc_nonshared.a,crt1.oThe above are also copied to the build/ folder and later copied to lindfs when
make install-tinyccis run.To run dynamically linked executables produced by tinycc, dynamic linker is used. Since the executable is run natively, we provide a symbolic link to the 32-bit dynamic linker within
/libof the root filesystem so that the kernel can locate the dynamic linker.Steps to reproduce