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

add ckb-c-stdlib as a submodule #12

Merged
merged 18 commits into from
Sep 11, 2023

Conversation

contrun
Copy link

@contrun contrun commented Sep 6, 2023

This pull request adds ckb-c-stdlib as a git submodule. We have added quite a few functions to the ckb-c-stdlib (the complete list can be viewed from nervosnetwork/ckb-c-stdlib@master...contrun:ckb-c-stdlib:ckb-lua ). Theoretically we can use master branch of nervosnetwork/ckb-c-stdlib and add these functions to the ckb-lua repo, but keeping them in ckb-c-stdlib makes more sense. I currently use the this branch as a git submodule.

@contrun contrun force-pushed the update-ckb-c-stdlib branch from 548c564 to 56ac98b Compare September 7, 2023 00:59
@contrun contrun force-pushed the update-ckb-c-stdlib branch from 6da4bfd to 21e0121 Compare September 7, 2023 05:31
@contrun contrun force-pushed the update-ckb-c-stdlib branch from 6854e7f to 48069fd Compare September 7, 2023 07:10
.gitmodules Outdated Show resolved Hide resolved
@@ -5,7 +5,7 @@ CC := $(TARGET)-gcc
LD := $(TARGET)-gcc
OBJCOPY := $(TARGET)-objcopy

CFLAGS := -fPIC -O3 -fno-builtin -nostdinc -nostdlib -nostartfiles -fvisibility=hidden -fdata-sections -ffunction-sections -I lualib -I include/ckb-c-stdlib -I include/ckb-c-stdlib/libc -I include/ckb-c-stdlib/molecule -Wall -Werror -Wno-nonnull -Wno-nonnull-compare -Wno-unused-function -g
CFLAGS := -D__ISO_C_VISIBLE=1999 -fPIC -O3 -fno-builtin -nostdinc -nostdlib -nostartfiles -fvisibility=hidden -fdata-sections -ffunction-sections -I lualib -I lualib/c-stdlib -I include/ckb-c-stdlib -I include/ckb-c-stdlib/libc -I include/ckb-c-stdlib/molecule -Wall -Werror -Wno-nonnull -Wno-nonnull-compare -Wno-unused-function -Wno-error=maybe-uninitialized -g
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this macro "__ISO_C_VISIBLE=1999" used?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If __ISO_C_VISIBLE=1999 then LLONG_MAX is defined here https://github.com/nervosnetwork/ckb-c-stdlib/blob/efe1fe6b3cdda12e248e25664f5c04cbf7876265/libc/limits.h#L94 . Lua check the definition of LLONG_MAX https://github.com/nervosnetwork/ckb-lua/blob/b71d44288e8fb085074d3af056b359b8c6c22afa/lualib/luaconf.h#L502 to define a few things. This is somewhat dirty.

@XuJiandong XuJiandong merged commit 189ec17 into nervosnetwork:master Sep 11, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants