You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/04/06 03:45:23 UTC

[GitHub] [incubator-nuttx-apps] yamt opened a new pull request, #1124: Symtab vs builtin

yamt opened a new pull request, #1124:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1124

   ## Summary
   Use -fno-builtin for SYMTABOBJ
   
   The code generated by tools/mksymtab.sh uses
   ```
   extern void *var;
   ```
   for ~everything.
   
   After the recent removal of -fno-builtin, [1]
   it ends up with warnings:
   * -Wbuiltin-requires-header for clang
   * -Wbuiltin-declaration-mismatch for gcc
   
   It also generates errors like the following for clang:
   ```
   symtab_apps.c:125:14: error: redefinition of 'strdup' as different kind of symbol
   extern void *strdup;
   ```
   I couldn't find a way to disable it.
   (it's err_redefinition_different_kind in clang source)
   
   This commit works it around by restoring -fno-builtin
   when building SYMTABOBJ.
   
   [1] https://github.com/apache/incubator-nuttx/pull/5476
   
   ## Impact
   
   ## Testing
   
   tested with my app + sim/linux + clang


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx-apps] yamt commented on a diff in pull request #1124: Restore -fno-builtin for SYMTABOBJ

Posted by GitBox <gi...@apache.org>.
yamt commented on code in PR #1124:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1124#discussion_r871005295


##########
examples/elf/Makefile:
##########
@@ -30,6 +30,8 @@ CSRCS = cromfs.c
 endif
 CSRCS += dirlist.c
 CSRCS += symtab.c
+tests$(DELIM)symtab.c_CFLAGS = -fno-builtin

Review Comment:
   ideally, maybe.
   we are using `-fno-lto` in the common file as well.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx-apps] xiaoxiang781216 commented on pull request #1124: Restore -fno-builtin for SYMTABOBJ

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on PR #1124:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1124#issuecomment-1089894577

   > > syscall may need the similar change too
   > 
   > do you mean the table generated from syscall.csv and libc.csv? i guess they are ok as they use correct prototypes.
   
   Yes, you are right. After search "Wbuiltin-declaration-mismatch", only https://github.com/apache/incubator-nuttx/blob/master/tools/mkallsyms.sh need the similar change.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx-apps] xiaoxiang781216 merged pull request #1124: Restore -fno-builtin for SYMTABOBJ

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged PR #1124:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1124


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx-apps] yamt commented on pull request #1124: Restore -fno-builtin for SYMTABOBJ

Posted by GitBox <gi...@apache.org>.
yamt commented on PR #1124:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1124#issuecomment-1124543599

   > > > syscall may need the similar change too
   > > 
   > > 
   > > do you mean the table generated from syscall.csv and libc.csv? i guess they are ok as they use correct prototypes.
   > 
   > Yes, you are right. After search "Wbuiltin-declaration-mismatch", only https://github.com/apache/incubator-nuttx/blob/master/tools/mkallsyms.sh need the similar change.
   
   https://github.com/apache/incubator-nuttx/pull/6247


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx-apps] xiaoxiang781216 commented on pull request #1124: Restore -fno-builtin for SYMTABOBJ

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on PR #1124:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1124#issuecomment-1089793477

   syscall may need the similar change too


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx-apps] xiaoxiang781216 commented on a diff in pull request #1124: Restore -fno-builtin for SYMTABOBJ

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #1124:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1124#discussion_r870981228


##########
examples/elf/Makefile:
##########
@@ -30,6 +30,8 @@ CSRCS = cromfs.c
 endif
 CSRCS += dirlist.c
 CSRCS += symtab.c
+tests$(DELIM)symtab.c_CFLAGS = -fno-builtin

Review Comment:
   should we expose -fno-builtin with a macro in Toolchain.defs/Make.defs to avoid the hardcode value in the common file?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx-apps] yamt commented on pull request #1124: Restore -fno-builtin for SYMTABOBJ

Posted by GitBox <gi...@apache.org>.
yamt commented on PR #1124:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1124#issuecomment-1089795709

   > syscall may need the similar change too
   
   do you mean the table generated from syscall.csv and libc.csv?
   i guess they are ok as they use correct prototypes.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx-apps] pkarashchenko commented on a diff in pull request #1124: Restore -fno-builtin for SYMTABOBJ

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #1124:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1124#discussion_r843490225


##########
examples/thttpd/Makefile:
##########
@@ -31,6 +31,8 @@ ifeq ($(CONFIG_THTTPD_BINFS),y)
 else
   CONTENT_MAKE += -f Makefile.nxflat
   CSRCS += symtab.c
+  symtab.c_CFLAGS = -fno-builtin

Review Comment:
   @xiaoxiang781216 maybe we also can use the similar for memcpy and other functions instead of adding an attribute that was added to compiler.h?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org