apps/Makefile: Support passing additional arguments to mksymtab.sh#2637
Merged
xiaoxiang781216 merged 2 commits intoOct 7, 2024
Merged
Conversation
|
[Experimental Bot, please feedback here] The PR appears to meet most NuttX requirements, but some clarifications and additions are needed: Summary:
Impact:
Testing:
By addressing these points, you'll make your PR easier to review and merge. |
631686c to
8e5581e
Compare
Contributor
Author
|
Using
|
Use the "-a" option to specify additional lists
Examples
- The basic.txt
$ cat basic.txt
basic_func0
basic_func1
basic_func2
- The additional.txt
$ cat additional.txt
additional_func0
additional_func1
additional_func2
1. Get symbols from directory "EMPTY_DIR" and additional list basic.txt
./tools/mksymtab.sh ./EMPTY_DIR -a basic.txt
#if defined(CONFIG_EXECFUNCS_HAVE_SYMTAB)
const struct symtab_s CONFIG_EXECFUNCS_SYMTAB_ARRAY[] =
#elif defined(CONFIG_NSH_SYMTAB)
const struct symtab_s CONFIG_NSH_SYMTAB_ARRAYNAME[] =
#else
const struct symtab_s dummy_symtab[] =
#endif
{
{"basic_func0", &basic_func0},
{"basic_func1", &basic_func1},
{"basic_func2", &basic_func2},
};
2. Get symbols from directory "EMPTY_DIR" and two additional lists basic.txt, additional.txt
./tools/mksymtab.sh ./EMPTY_DIR -a basic.txt -a additional.txt
#if defined(CONFIG_EXECFUNCS_HAVE_SYMTAB)
const struct symtab_s CONFIG_EXECFUNCS_SYMTAB_ARRAY[] =
#elif defined(CONFIG_NSH_SYMTAB)
const struct symtab_s CONFIG_NSH_SYMTAB_ARRAYNAME[] =
#else
const struct symtab_s dummy_symtab[] =
#endif
{
{"additional_func0", &additional_func0},
{"additional_func1", &additional_func1},
{"additional_func2", &additional_func2},
{"basic_func0", &basic_func0},
{"basic_func1", &basic_func1},
{"basic_func2", &basic_func2},
};
3. Set prefix and get symbols from directory "EMPTY_DIR" and two additional lists basic.txt, additional.txt
./tools/mksymtab.sh ./EMPTY_DIR PREFIX_TEST -a basic.txt -a additional.txt
const struct symtab_s PREFIX_TEST_exports[] =
{
{"additional_func0", &additional_func0},
{"additional_func1", &additional_func1},
{"additional_func2", &additional_func2},
{"basic_func0", &basic_func0},
{"basic_func1", &basic_func1},
{"basic_func2", &basic_func2},
};
4. Error: Missing <imagedirpath>
$ ./tools/mksymtab.sh
ERROR: Missing <imagedirpath>
Usage: ./tools/mksymtab.sh <imagedirpath> [symtabprefix] [-a additionalsymbolspath]
UNSUPPORTED usage examples
# `getopt` supports these, but the usage in GNU and macOS is incompatible.
- ./tools/mksymtab.sh ./EMPTY_DIR -a basic.txt PREFIX_TEST -a additional.txt
- ./tools/mksymtab.sh -a basic.txt ./EMPTY_DIR PREFIX_TEST -a additional.txt
References
BASH(1) -- getopts
GETOPT(1) -- getopt
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
8e5581e to
f92a0a8
Compare
cederom
approved these changes
Oct 7, 2024
Contributor
cederom
left a comment
There was a problem hiding this comment.
Thank you @JianyuWang0623 :-)
JianyuWang0623
added a commit
to JianyuWang0623/nuttx-apps
that referenced
this pull request
Oct 7, 2024
apache#2637 For example, now can passing file(s) contain additional symbols that may be used in the future to mksymtab.sh by using "-a" option to avoid freuent kernel rebuilds: SYMTABLST="-a $(XXXX_PREFIX)/platform/nuttx/exports_xxxx_api.txt" ifneq ($(CONFIG_LIBM),) SYMTABLST+="-a $(XXXX_PREFIX)/platform/nuttx/exports_xxxx_api_math.txt" endif Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
f92a0a8 to
e5cd959
Compare
apache#2637 For example, now can passing file(s) contain additional symbols that may be used in the future to mksymtab.sh by using "-a" option to avoid freuent kernel rebuilds: SYMTABEXT="-a $(XXXX_PREFIX)/platform/nuttx/exports_xxxx_api.txt" ifneq ($(CONFIG_LIBM),) SYMTABEXT+="-a $(XXXX_PREFIX)/platform/nuttx/exports_xxxx_api_math.txt" endif Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
e5cd959 to
f1ad62a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Impact
Usage of mksymtab.sh about param "additionalsymbolspath" changed, has checked by searching in nuttx-apps and nuttx.
"additionalsymbolspath" should not depends on "symtabprefix".
Testing