mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 15:58:59 +08:00
sim: detect clang native compiler on MacOS.
This commit is contained in:
@@ -285,11 +285,14 @@ nuttx-names.dat: nuttx-names.in
|
|||||||
nuttx$(EXEEXT): libarch$(LIBEXT) board/libboard$(LIBEXT) $(HEADOBJ) $(LINKOBJS) $(HOSTOBJS) nuttx-names.dat
|
nuttx$(EXEEXT): libarch$(LIBEXT) board/libboard$(LIBEXT) $(HEADOBJ) $(LINKOBJS) $(HOSTOBJS) nuttx-names.dat
|
||||||
$(Q) echo "LD: nuttx$(EXEEXT)"
|
$(Q) echo "LD: nuttx$(EXEEXT)"
|
||||||
$(Q) $(LD) -r $(LDLINKFLAGS) $(RELPATHS) $(EXTRA_LIBPATHS) -o nuttx.rel $(REQUIREDOBJS) $(LDSTARTGROUP) $(RELLIBS) $(EXTRA_LIBS) $(LDENDGROUP)
|
$(Q) $(LD) -r $(LDLINKFLAGS) $(RELPATHS) $(EXTRA_LIBPATHS) -o nuttx.rel $(REQUIREDOBJS) $(LDSTARTGROUP) $(RELLIBS) $(EXTRA_LIBS) $(LDENDGROUP)
|
||||||
|
ifeq ("$(shell $(CC) --version | grep clang)","")
|
||||||
|
# none clang based native compilers need opjcopy to build simulation
|
||||||
$(Q) $(OBJCOPY) --redefine-syms=nuttx-names.dat nuttx.rel
|
$(Q) $(OBJCOPY) --redefine-syms=nuttx-names.dat nuttx.rel
|
||||||
$(Q) $(CC) $(CCLINKFLAGS) -Wl,-verbose 2>&1 | \
|
$(Q) $(CC) $(CCLINKFLAGS) -Wl,-verbose 2>&1 | \
|
||||||
sed -e '/====/,/====/!d;//d' -e 's/__executable_start/_stext/g' -e 's/__init_array_start/_sinit/g' \
|
sed -e '/====/,/====/!d;//d' -e 's/__executable_start/_stext/g' -e 's/__init_array_start/_sinit/g' \
|
||||||
-e 's/__init_array_end/_einit/g' -e 's/__fini_array_start/_sfini/g' -e 's/__fini_array_end/_efini/g' >nuttx.ld
|
-e 's/__init_array_end/_einit/g' -e 's/__fini_array_start/_sfini/g' -e 's/__fini_array_end/_efini/g' >nuttx.ld
|
||||||
$(Q) echo "__init_array_start = .; __init_array_end = .; __fini_array_start = .; __fini_array_end = .;" >>nuttx.ld
|
$(Q) echo "__init_array_start = .; __init_array_end = .; __fini_array_start = .; __fini_array_end = .;" >>nuttx.ld
|
||||||
|
endif
|
||||||
$(if $(CONFIG_HAVE_CXX),\
|
$(if $(CONFIG_HAVE_CXX),\
|
||||||
$(Q) "$(CXX)" $(CCLINKFLAGS) $(LIBPATHS) $(ARCHSCRIPT) -o $(TOPDIR)/$@ $(HEADOBJ) nuttx.rel $(HOSTOBJS) $(STDLIBS),\
|
$(Q) "$(CXX)" $(CCLINKFLAGS) $(LIBPATHS) $(ARCHSCRIPT) -o $(TOPDIR)/$@ $(HEADOBJ) nuttx.rel $(HOSTOBJS) $(STDLIBS),\
|
||||||
$(Q) "$(CC)" $(CCLINKFLAGS) $(LIBPATHS) $(ARCHSCRIPT) -o $(TOPDIR)/$@ $(HEADOBJ) nuttx.rel $(HOSTOBJS) $(STDLIBS))
|
$(Q) "$(CC)" $(CCLINKFLAGS) $(LIBPATHS) $(ARCHSCRIPT) -o $(TOPDIR)/$@ $(HEADOBJ) nuttx.rel $(HOSTOBJS) $(STDLIBS))
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ static char g_logbuffer[4096];
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
__attribute__ ((visibility("default")))
|
||||||
int main(int argc, char **argv, char **envp)
|
int main(int argc, char **argv, char **envp)
|
||||||
{
|
{
|
||||||
g_argc = argc;
|
g_argc = argc;
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ bool up_interrupt_context(void)
|
|||||||
* Name: up_doirq
|
* Name: up_doirq
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
__attribute__ ((visibility("default")))
|
||||||
void *up_doirq(int irq, void *context)
|
void *up_doirq(int irq, void *context)
|
||||||
{
|
{
|
||||||
/* Allocate temporary context on the stack */
|
/* Allocate temporary context on the stack */
|
||||||
|
|||||||
@@ -399,6 +399,7 @@ int netdriver_init(void)
|
|||||||
return netdev_register(dev, NET_LL_ETHERNET);
|
return netdev_register(dev, NET_LL_ETHERNET);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__attribute__ ((visibility("default")))
|
||||||
void netdriver_setmacaddr(unsigned char *macaddr)
|
void netdriver_setmacaddr(unsigned char *macaddr)
|
||||||
{
|
{
|
||||||
memcpy(g_sim_dev.d_mac.ether.ether_addr_octet, macaddr, IFHWADDRLEN);
|
memcpy(g_sim_dev.d_mac.ether.ether_addr_octet, macaddr, IFHWADDRLEN);
|
||||||
|
|||||||
@@ -217,6 +217,7 @@ int up_cpu_paused(int cpu)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
__attribute__ ((visibility("default")))
|
||||||
void up_cpu_started(void)
|
void up_cpu_started(void)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_SCHED_INSTRUMENTATION
|
#ifdef CONFIG_SCHED_INSTRUMENTATION
|
||||||
@@ -285,6 +286,7 @@ int up_cpu_start(int cpu)
|
|||||||
* On success returns OK (0), otherwise a negative value.
|
* On success returns OK (0), otherwise a negative value.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
__attribute__ ((visibility("default")))
|
||||||
int up_init_ipi(int irq)
|
int up_init_ipi(int irq)
|
||||||
{
|
{
|
||||||
up_enable_irq(irq);
|
up_enable_irq(irq);
|
||||||
|
|||||||
Reference in New Issue
Block a user