Commit Graph

38 Commits

Author SHA1 Message Date
Gregory Nutt
1056cce2b5 apps/examples/elf: Correct mount point configuration error.
If an external file system is used but is not mounted by the the ELF example, then a compilation error will occur.  This configuration problem has existed for a long time but was unmasked by a recent PR.  In the failure mode, CONFIG_EXAMPLES_ELF_FSTYPE would not be defined because it depends on CONFIG_EXAMPLES_ELF_FSMOUNT which is not defined.  The resulting mountpoint, MOUNTPT, would therefore be left in an invalid state.  Previous changes to conditional logic now allowed setenv() to run and to attempt to set the PATH variable to MOUNTPT, causing a compile time failure like this:

    CC:  elf_main.c
    elf_main.c: In function 'elf_main':
    elf_main.c:113:32: error: expected ')' before 'CONFIG_EXAMPLES_ELF_FSTYPE'
     #  define MOUNTPT      "/mnt/" CONFIG_EXAMPLES_ELF_FSTYPE
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~
    elf_main.c:364:18: note: in expansion of macro 'MOUNTPT'
       setenv("PATH", MOUNTPT, 1);
                       ^~~~~~~
    elf_main.c:364:3: error: too few arguments to function 'setenv'
       setenv("PATH", MOUNTPT, 1);
       ^~~~~~
    In file included from elf_main.c:47:
    D:\Spuda\Documents\projects\nuttx\master\nuttx-fork\include/stdlib.h:158:11: note: declared here
     int       setenv(FAR const char *name, FAR const char *value, int overwrite);
               ^~~~~~

This problem was found during manual build testing using configuration lx_cpu:nsh.
2020-02-15 18:06:43 +01:00
YAMAMOTO Takashi
66e7590dd0 examples/elf: Don't bother to honor CONFIG_PATH_INITIAL
As we know where the binaries are, there's little point
to use CONFIG_PATH_INITIAL.
2020-02-14 18:38:07 +08:00
Xiang Xiao
857158451b Unify the void cast usage
1.Remove void cast for function because many place ignore the returned value witout cast
2.Replace void cast for variable with UNUSED macro

Change-Id: Ie644129a563244a6397036789c4c3ea83c4e9b09
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-01-02 23:21:01 +08:00
Xiang Xiao
e806097c70 Application.mk and main.c files: Change builtin's entry point from main to xxx_main by macro expansion. This change make the entry point fully compliant with POSIX/ANSI standard. 2019-10-06 06:14:56 -06:00
Gregory Nutt
9db029e318 The file system can no longer be disabled. Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS==0 2019-02-11 13:10:10 -06:00
anchao
3432acf7c4 apps/: Rename BINFMT_EXEPATH to LIB_ENVPATH. 2018-11-08 07:31:52 -06:00
anchao
220653f21c Squashed commit of the following:
Author: anchao <anchao@pinecone.net>

     apps/, most main() function: Correct CONFIG_BUILD_LOADABLE usage
     Loadable apps/: Correct loadable symbol table generate
     apps/system/ubloxmodem:  Fix build break
     apps/examples/ostest: start restart/waitpid/user test from main loop
     apps/nshlib:  Expand reboot and poweroff commands to include a second, optional mode argument

    Author: Gregory Nutt <gnutt@nuttx.org>

     An attempt to fix build issues.  Does not work.
     apps/examples/ostest:  Fix some inappropriate renaming of static functions introduced with recent patches.
     apps/builtin/exec_builtin.c:  Fix a error introduced by recent comments.  Found in build testing.

    Author: anchao <anchao@pinecone.net>

     apps/builtin/exec_builtin.c:  Try posix_spawn if builtin apps do not have have an entry point.
     apps/Application.mk: introduce MODULE config to simplify tristate(m)
     apps/nsh:  Change the nuttx shell module type to tristate
     apps:  Add loadable application support
     script/mksymtab:  Generate symbol table name by default
     apps/builtin:  Allow loadable applications can register with apps/builtin.
2018-08-23 11:06:15 -06:00
Gregory Nutt
2f982e9c77 Revert "Squashed commit of the following:"
This reverts commit 25b92edd9f.
2018-08-22 12:06:32 -06:00
anchao
25b92edd9f Squashed commit of the following:
apps/builtin/exec_builtin.c:  Try posix_spawn if builtin apps do not have have an entry point.
    apps/Application.mk: introduce MODULE config to simplify tristate(m)
    apps/nsh:  Change the nuttx shell module type to tristate
    apps:  Add loadable application support
    script/mksymtab:  Generate symbol table name by default
    apps/builtin:  Allow loadable applications can register with apps/builtin.
2018-08-22 09:30:38 -06:00
Gregory Nutt
8572f223ae apps/examples/elf: If the test ELF files are on media in removable meda such as SD or USB FLASH, the wait until the media has been installed and initialized before starting the test. 2018-08-04 16:24:02 -06:00
Gregory Nutt
ba2d9e7c42 apps/examples/elf: CROMFS and ROMFS configuration currently only usable in FLAT build. Add configuration to use ELF objects on external media like SD card or USB drive instead. 2018-08-04 13:10:40 -06:00
Gregory Nutt
5ecec24084 There many occurences of the global variable g_exports and the opportunity for collisions. Make the global variable names unique. 2018-07-14 16:36:25 -06:00
Gregory Nutt
654ee7e6f9 apps/examples/elf, module, posix_spawn: Correct naming of global variables that violations the naming requirements of the coding standard. 2018-07-12 09:53:38 -06:00
Gregory Nutt
e413211e6e apps/examples/elf: Remove some debug code that was left in the previous commit. 2018-03-24 12:49:37 -06:00
Gregory Nutt
dbdfad8ff5 apps/examples/elf: Extend the ELF program module demo so that you can use compressed ELF programs with CROMFS. 2018-03-24 11:36:20 -06:00
Gregory Nutt
947cbf6d7b apps/examples/nsh and posix_spawn: Must not call exec_setsymtab() directly. That is a non-POSIX internal OS interface. 2018-03-16 08:51:49 -06:00
Gregory Nutt
1db7d34a84 examples/elf and nxff: Won't build with CONFIG_BUILD_KERNEL because the interface exec() is not available in that configuration. Also, remove a stray comma and a stray semacolon in examples/pty_test/Kconfig and examples/random/Kconfig 2017-10-06 15:13:00 -06:00
Gregory Nutt
56814bec38 apps/examples: In elf and nxflat examples, remove low-level interfaces and replace with call to exec(). 2017-10-02 14:32:17 -06:00
Gregory Nutt
b08ea68a33 Move prototype from nuttx/include/nuttx/arch.h to apps/include/platform/cxxinitialize.h 2017-05-13 16:53:33 -06:00
Gregory Nutt
d5b7268d95 ramdisk.h moved from include/fs/nuttx/ to include/nuttx/drivers. 2016-07-20 14:02:41 -06:00
Gregory Nutt
5098539063 Add _ to front of remaining debug macros 2016-06-16 12:12:34 -06:00
Gregory Nutt
cc03ecefc8 Rename err() to _err() 2016-06-16 11:44:22 -06:00
Gregory Nutt
586b0aa7e0 Change names of *dbg() * *err() 2016-06-11 15:51:27 -06:00
Gregory Nutt
e82a54bf18 Reserver the name 'err' for other purposes 2016-06-11 14:49:55 -06:00
Gregory Nutt
468bdcf8e6 Rename CONFIG_DEBUG to CONFIG_DEBUG_FEATURES 2016-06-11 14:13:39 -06:00
Gregory Nutt
e9447c6058 Standardize nameing of the pre-processor definitiongs group header 2015-10-02 14:06:11 -06:00
Gregory Nutt
5f6b3276a2 apps/examples/elf: Add configuration optionst o support building the hello++4 example that depends upon having uClibc++ available. From Leo aloe3132. 2015-05-29 11:47:40 -06:00
Gregory Nutt
d8a239d649 Use more standard *argv[] instead easier **argv 2014-09-06 09:23:23 -06:00
Gregory Nutt
9f7c9b273f With kernel build, entry point to all tasks is main, not some xyz_main 2014-09-06 09:19:15 -06:00
Gregory Nutt
2b0f1ed109 Change all variadic macros to C99 style 2014-05-22 09:01:51 -06:00
Gregory Nutt
745de760de Add a ROMFS file system for testing the P-Code binary format 2014-05-08 11:08:01 -06:00
Gregory Nutt
d9f6b144bc Move ramdisk.h to include/nutt/fs/ramdisk.h 2013-12-10 09:42:58 -06:00
patacongo
b9012ee3ec Change the way thread priority is handled in binfmt/ to better match the way that priority is set up for the builtin tasks
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5527 42af7a65-404d-4744-a932-0658087f49c3
2013-01-17 00:30:12 +00:00
patacongo
1f42490e3c Some minor fixes for CONFIG_ADDRENV=y
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5444 42af7a65-404d-4744-a932-0658087f49c3
2012-12-19 21:16:03 +00:00
patacongo
cc5fbb7246 C++ constructors work with ELF load now
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5273 42af7a65-404d-4744-a932-0658087f49c3
2012-10-29 19:32:05 +00:00
patacongo
603f1f0317 The ELF loader is basically functional (needs more testing)
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5265 42af7a65-404d-4744-a932-0658087f49c3
2012-10-27 00:04:47 +00:00
patacongo
449d1d82e4 Rename elf.h to elf32.h; Additional ELF loader changes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5263 42af7a65-404d-4744-a932-0658087f49c3
2012-10-26 02:42:39 +00:00
patacongo
90d055bbfa More ELF loader changes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5261 42af7a65-404d-4744-a932-0658087f49c3
2012-10-25 22:10:56 +00:00