commit 2748c74c2024e64e4fd6cd06ec5dd78c93ffbf3c
parent 86fb1e4592b3999d4e557103bd3c2360482ff03a
Author: Remy Noulin <loader2x@gmail.com>
Date: Wed, 26 May 2021 10:00:31 +0200
fix tcc linking
tcc version 0.9.27 (latest as of now) doesn't link correctly the
functions in libsheepyObject.
Only the functions in libsheepy.h are usable.
The source program template should be changed to include libsheepy.h
instead of libsheepyObject.h:
/* or direct path to sheepy: #! /usr/local/bin/sheepy */
/* Libsheepy documentation: https://spartatek.se/libsheepy/ */
int argc; char **argv;
/* enable/disable logging */
/* #undef pLog */
/* #define pLog(...) */
int main(int ARGC, char** ARGV) {
argc = ARGC; argv = ARGV;
logI("C template");
}
// vim: set expandtab ts=2 sw=2:
src/sheepy.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/sheepy.c b/src/sheepy.c
@@ -2188,8 +2188,8 @@ int MAIN(int ARGC, char** ARGV) {
}
else {
// TODO update command
- ld = malloc(strlen(rootMain) + strlen(rootMain) + strlen(incObjFiles) + strlen(aLibFiles) + strlen(libsheepyDir) + strlen(libsheepy) + strlen(lflags) + strlen(run) + 1 + 25);
- sprintf(ld, "tcc -o %s %s.o %s %s %s/%s -pthread %s %s", rootMain, rootMain, incObjFiles, aLibFiles, libsheepyDir, libsheepy, lflags, run);
+ ld = malloc(strlen(buildExePath) + strlen(mainOPath) + strlen(incObjFiles) + strlen(aLibFiles) + strlen(libsheepyDir) + strlen(libsheepy) + strlen(lflags) + strlen(run) + 1 + 23);
+ sprintf(ld, "tcc -o %s %s %s %s %s/%s -pthread %s %s", buildExePath, mainOPath, incObjFiles, aLibFiles, libsheepyDir, libsheepy, lflags, run);
}
free(lflags);