[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Minios-devel] [UNIKRAFT/SQLITE V3 PATCH 4/5] Add patches directory
Hi Gaulthier, Instead of patching the original code, we used another trick so far. We used the C preprocessor in order to replace `main` with the new name (please have a look here [1]). So, in your case you would need to add in Makefile.uk: LIBSQLITE_SHELL_FLAGS-y += -Dmain=sqlite_main I would not rename the `wmain()` function though, I would call it from your main() example (please see the comments for patch 3). [1] https://github.com/unikraft/lib-redis/blob/staging/Makefile.uk#L210 Cheers, Costin On 12/4/19 7:52 PM, Gaulthier Gain wrote: > Patch to rename SQLite main function in order to provide an optional > glue main function. > > Signed-off-by: Gaulthier Gain <gaulthier.gain@xxxxxxxxx> > --- > patches/0001-rename-entry-point.patch | 28 ++++++++++++++++++++++++++++ > 1 file changed, 28 insertions(+) > create mode 100644 patches/0001-rename-entry-point.patch > > diff --git a/patches/0001-rename-entry-point.patch > b/patches/0001-rename-entry-point.patch > new file mode 100644 > index 0000000..2516109 > --- /dev/null > +++ b/patches/0001-rename-entry-point.patch > @@ -0,0 +1,28 @@ > +From d967f4c487386c48f0a86dfa6a8f2a3628a9280a Mon Sep 17 00:00:00 2001 > +From: Gaulthier Gain <gaulthier.gain@xxxxxxxxx> > +Date: Mon, 2 Dec 2019 16:56:10 +0100 > +Subject: [LIBSQLITE] [PATCH] Rename main function to sqlite_main > + > +Signed-off-by: Gaulthier Gain <gaulthier.gain@xxxxxxxxx> > +--- > + shell.c | 4 ++-- > + 1 file changed, 2 insertions(+), 2 deletions(-) > + > +diff --git a/shell.c b/shell.c > +index 053180c..3fe0618 100644 > +--- a/shell.c > ++++ b/shell.c > +@@ -18599,9 +18599,9 @@ static char *cmdline_option_value(int argc, char > **argv, int i){ > + #endif > + > + #if SQLITE_SHELL_IS_UTF8 > +-int SQLITE_CDECL main(int argc, char **argv){ > ++int SQLITE_CDECL sqlite_main(int argc, char **argv){ > + #else > +-int SQLITE_CDECL wmain(int argc, wchar_t **wargv){ > ++int SQLITE_CDECL sqlite_main(int argc, wchar_t **wargv){ > + char **argv; > + #endif > + char *zErrMsg = 0; > +-- > +2.11.0 > _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |