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/02/13 23:29:46 UTC
[GitHub] [incubator-nuttx] masayuki2009 opened a new pull request #5485: boards: sabre-6quad: Add -fno-common to Make.defs
masayuki2009 opened a new pull request #5485:
URL: https://github.com/apache/incubator-nuttx/pull/5485
## Summary
- I noticed that the following error happened when loading the init
'elf_symvalue: SHN_COMMON: Re-compile with -fno-common'
- This commit fixes this issue
## Impact
- sabre-6quad only
## Testing
- Tested with sabre-6quad:netknsh (not merged yet)
--
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] xiaoxiang781216 edited a comment on pull request #5485: boards: sabre-6quad: Add -fno-common to Make.defs
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 edited a comment on pull request #5485:
URL: https://github.com/apache/incubator-nuttx/pull/5485#issuecomment-1039826690
Yes, I think the direction is right. -fno-common should be added to all source code(elf binary and core os) who want to use elf related feature.
Since elf is a common feature, I would suggest to add -fno-common in ARCHCFLAGS for all board files(except we hit the error similar to esp32c3-devkit:wapi. Otherwise, people will hit the similar issue again and again.
BTW, -fno-common encourage the good practice, I don't see there is any negative side effect to enable it(except compatible with some prebuilt library).
--
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] masayuki2009 commented on a change in pull request #5485: boards: sabre-6quad: Add -fno-common to Make.defs
Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on a change in pull request #5485:
URL: https://github.com/apache/incubator-nuttx/pull/5485#discussion_r806327482
##########
File path: arch/arm/src/rtl8720c/Toolchain.defs
##########
@@ -50,8 +50,8 @@ ifneq ($(CONFIG_ARMV8M_STACKCHECK),y)
endif
endif
-ARCHCFLAGS = -fno-builtin -march=armv8-m.main+dsp -mthumb -mfloat-abi=soft -D__thumb2__ -g -gdwarf-3 -Os -fno-tree-scev-cprop
-ARCHCXXFLAGS = -fno-builtin -nostdinc++ -std=c++11
+ARCHCFLAGS = -fno-builtin -march=armv8-m.main+dsp -mthumb -mfloat-abi=soft -D__thumb2__ -g -gdwarf-3 -Os -fno-tree-scev-cprop -fno-common
Review comment:
@pkarashchenko
Do you mean that `-fno-common` should be moved to `ARCHOPTIMIZATION`
or `-ffunction-sections -fdata-sections` should be moved to `ARCHCFLAGS/ARCHCXXFLAGS` ?
--
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] xiaoxiang781216 commented on pull request #5485: boards: sabre-6quad: Add -fno-common to Make.defs
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #5485:
URL: https://github.com/apache/incubator-nuttx/pull/5485#issuecomment-1039828003
How about we:
1. replace "ARCHC[XX]FLAGS =" with "ARCHC[XX]FLAGS = -fno-common" and revert the change which hit the multiple definition link error.
2. Remove -fno-common from CELFFLAGS/CXXELFFLAGS
--
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] Ouss4 commented on pull request #5485: boards: sabre-6quad: Add -fno-common to Make.defs
Posted by GitBox <gi...@apache.org>.
Ouss4 commented on pull request #5485:
URL: https://github.com/apache/incubator-nuttx/pull/5485#issuecomment-1039114845
There is this in the documentation:
> The default is -fno-common, which specifies that the compiler places uninitialized global variables in the BSS section of the object file. This inhibits the merging of tentative definitions by the linker so you get a multiple-definition error if the same variable is accidentally defined in more than one compilation unit.
I don't know if the libraries are built with `-fcommon`.
--
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] pkarashchenko commented on a change in pull request #5485: boards: sabre-6quad: Add -fno-common to Make.defs
Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5485:
URL: https://github.com/apache/incubator-nuttx/pull/5485#discussion_r806368451
##########
File path: arch/arm/src/rtl8720c/Toolchain.defs
##########
@@ -50,8 +50,8 @@ ifneq ($(CONFIG_ARMV8M_STACKCHECK),y)
endif
endif
-ARCHCFLAGS = -fno-builtin -march=armv8-m.main+dsp -mthumb -mfloat-abi=soft -D__thumb2__ -g -gdwarf-3 -Os -fno-tree-scev-cprop
-ARCHCXXFLAGS = -fno-builtin -nostdinc++ -std=c++11
+ARCHCFLAGS = -fno-builtin -march=armv8-m.main+dsp -mthumb -mfloat-abi=soft -D__thumb2__ -g -gdwarf-3 -Os -fno-tree-scev-cprop -fno-common
Review comment:
This is a point for discussion, but I think we should move `-fno-common` to `ARCHOPTIMIZATION`.
--
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] masayuki2009 commented on pull request #5485: boards: sabre-6quad: Add -fno-common to Make.defs
Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #5485:
URL: https://github.com/apache/incubator-nuttx/pull/5485#issuecomment-1039673417
--
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] masayuki2009 commented on pull request #5485: boards: sabre-6quad: Add -fno-common to Make.defs
Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #5485:
URL: https://github.com/apache/incubator-nuttx/pull/5485#issuecomment-1039850524
@xiaoxiang781216
I pushed all the changes again.
--
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] xiaoxiang781216 merged pull request #5485: boards: sabre-6quad: Add -fno-common to Make.defs
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #5485:
URL: https://github.com/apache/incubator-nuttx/pull/5485
--
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] masayuki2009 commented on a change in pull request #5485: boards: sabre-6quad: Add -fno-common to Make.defs
Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on a change in pull request #5485:
URL: https://github.com/apache/incubator-nuttx/pull/5485#discussion_r805479196
##########
File path: boards/arm/imx6/sabre-6quad/scripts/Make.defs
##########
@@ -45,6 +45,9 @@ ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef
ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10
+ARCHCFLAGS += -fno-common
+ARCHCXXFLAGS += -fno-common
Review comment:
Done
--
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] masayuki2009 commented on a change in pull request #5485: boards: sabre-6quad: Add -fno-common to Make.defs
Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on a change in pull request #5485:
URL: https://github.com/apache/incubator-nuttx/pull/5485#discussion_r805491532
##########
File path: boards/arm/imx6/sabre-6quad/scripts/Make.defs
##########
@@ -39,8 +39,8 @@ ifneq ($(CONFIG_DEBUG_NOOPT),y)
endif
ARCHCPUFLAGS = -mcpu=cortex-a9 -mfpu=vfpv4-d16
-ARCHCFLAGS = -fno-builtin -ffunction-sections -fdata-sections
-ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fcheck-new -fno-rtti
+ARCHCFLAGS = -fno-builtin -ffunction-sections -fdata-sections -fno-common
Review comment:
@xiaoxiang781216
I found that it's needed for libraries such as libc.a which is included in nuttx-export-x.x.x.zip and used to link applications. So ARCHCFLAGS and ARCHCXXFLAGS are better place.
--
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] masayuki2009 commented on pull request #5485: boards: sabre-6quad: Add -fno-common to Make.defs
Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #5485:
URL: https://github.com/apache/incubator-nuttx/pull/5485#issuecomment-1039763904
@xiaoxiang781216
I'm a little bit confused.
The original PR was only for sabre-6quad which is actually needed for `CONFIG_BUILD_KERNEL=y`.
In this case (not `CONFIG_BUILD_FLAT=y`), some libraries such as libc.a generated using `ARCHCFLAGS` is linked to applications such as init and hello.
As @ouss4 referred to the documentation, there is a side-effect of `-fno-common`.
Actually, I encountered link errors for esp32c3-devkit.
Originally, `-fno-common` is used for generating ELF files mostly for `CONFIG_BUILD_FLAT=y`.
So I think the right direction would be that
1. The option should be used to generate ELF files for `CONFIG_BUILD_FLAT=y` (i.e. the option should be included in `CELFFLAGS`)
2. The option should be used to generate object which will be linked to ELF files for `CONFIG_BUILD_KERNEL=y` (i.e. the option should be included in`ARCHCFLAGS`)
What do you think?
--
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] xiaoxiang781216 merged pull request #5485: boards: sabre-6quad: Add -fno-common to Make.defs
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #5485:
URL: https://github.com/apache/incubator-nuttx/pull/5485
--
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] xiaoxiang781216 commented on pull request #5485: boards: sabre-6quad: Add -fno-common to Make.defs
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #5485:
URL: https://github.com/apache/incubator-nuttx/pull/5485#issuecomment-1039826690
Yes, I think the direction is right. -fno-common should be added to all source code(elf binary and core os) who want to use elf related feature.
Since elf is a common feature, I would suggest to add -fno-common in ARCHCFLAGS for all board files(except we hit the error similar to esp32c3-devkit:wapi. Otherwise, people will hit the similar issue again and again.
BTW, -fno-common encourage the good practice, I don't there is any negative side effect to enable it(except compatible with some prebuilt library).
--
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] pkarashchenko commented on a change in pull request #5485: boards: sabre-6quad: Add -fno-common to Make.defs
Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5485:
URL: https://github.com/apache/incubator-nuttx/pull/5485#discussion_r806135123
##########
File path: arch/arm/src/rtl8720c/Toolchain.defs
##########
@@ -50,8 +50,8 @@ ifneq ($(CONFIG_ARMV8M_STACKCHECK),y)
endif
endif
-ARCHCFLAGS = -fno-builtin -march=armv8-m.main+dsp -mthumb -mfloat-abi=soft -D__thumb2__ -g -gdwarf-3 -Os -fno-tree-scev-cprop
-ARCHCXXFLAGS = -fno-builtin -nostdinc++ -std=c++11
+ARCHCFLAGS = -fno-builtin -march=armv8-m.main+dsp -mthumb -mfloat-abi=soft -D__thumb2__ -g -gdwarf-3 -Os -fno-tree-scev-cprop -fno-common
Review comment:
IMO it is good to group `-fno-common` with `-ffunction-sections -fdata-sections`
--
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] xiaoxiang781216 edited a comment on pull request #5485: boards: sabre-6quad: Add -fno-common to Make.defs
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 edited a comment on pull request #5485:
URL: https://github.com/apache/incubator-nuttx/pull/5485#issuecomment-1039826690
Yes, I think the direction is right. -fno-common should be added to all source code(elf binary and core os) who want to use elf related feature.
Since elf is a common feature, I would suggest to add -fno-common in ARCHCFLAGS for all board files(except we hit the error similar to esp32c3-devkit:wapi. Otherwise, people will hit the similar issue again and again.
BTW, -fno-common encourage the good practice, I don't see there is any negative side effect to enable it(except compatible with some prebuilt library).
--
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] xiaoxiang781216 commented on a change in pull request #5485: boards: sabre-6quad: Add -fno-common to Make.defs
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5485:
URL: https://github.com/apache/incubator-nuttx/pull/5485#discussion_r805483425
##########
File path: boards/arm/imx6/sabre-6quad/scripts/Make.defs
##########
@@ -39,8 +39,8 @@ ifneq ($(CONFIG_DEBUG_NOOPT),y)
endif
ARCHCPUFLAGS = -mcpu=cortex-a9 -mfpu=vfpv4-d16
-ARCHCFLAGS = -fno-builtin -ffunction-sections -fdata-sections
-ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fcheck-new -fno-rtti
+ARCHCFLAGS = -fno-builtin -ffunction-sections -fdata-sections -fno-common
Review comment:
If so, should we fix all place?
--
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] masayuki2009 commented on a change in pull request #5485: boards: sabre-6quad: Add -fno-common to Make.defs
Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on a change in pull request #5485:
URL: https://github.com/apache/incubator-nuttx/pull/5485#discussion_r806327482
##########
File path: arch/arm/src/rtl8720c/Toolchain.defs
##########
@@ -50,8 +50,8 @@ ifneq ($(CONFIG_ARMV8M_STACKCHECK),y)
endif
endif
-ARCHCFLAGS = -fno-builtin -march=armv8-m.main+dsp -mthumb -mfloat-abi=soft -D__thumb2__ -g -gdwarf-3 -Os -fno-tree-scev-cprop
-ARCHCXXFLAGS = -fno-builtin -nostdinc++ -std=c++11
+ARCHCFLAGS = -fno-builtin -march=armv8-m.main+dsp -mthumb -mfloat-abi=soft -D__thumb2__ -g -gdwarf-3 -Os -fno-tree-scev-cprop -fno-common
Review comment:
@pkarashchenko
Do you mean that `-fno-common` should be moved to `ARCHOPTIMIZATION`
or `-ffunction-sections -fdata-sections` should be moved to `ARCHCFLAGS/ARCHCXXFLAGS` ?
--
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] Ouss4 commented on pull request #5485: boards: sabre-6quad: Add -fno-common to Make.defs
Posted by GitBox <gi...@apache.org>.
Ouss4 commented on pull request #5485:
URL: https://github.com/apache/incubator-nuttx/pull/5485#issuecomment-1039078007
I'm not sure what's the cause of this redefinition. I too built locally and is working with no issues. Investigating...
--
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] masayuki2009 commented on a change in pull request #5485: boards: sabre-6quad: Add -fno-common to Make.defs
Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on a change in pull request #5485:
URL: https://github.com/apache/incubator-nuttx/pull/5485#discussion_r805491532
##########
File path: boards/arm/imx6/sabre-6quad/scripts/Make.defs
##########
@@ -39,8 +39,8 @@ ifneq ($(CONFIG_DEBUG_NOOPT),y)
endif
ARCHCPUFLAGS = -mcpu=cortex-a9 -mfpu=vfpv4-d16
-ARCHCFLAGS = -fno-builtin -ffunction-sections -fdata-sections
-ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fcheck-new -fno-rtti
+ARCHCFLAGS = -fno-builtin -ffunction-sections -fdata-sections -fno-common
Review comment:
@xiaoxiang781216
I found that it's needed for libraries such as libc.a which is included in nuttx-export-x.x.x.zip and used to link applications.
--
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] masayuki2009 commented on pull request #5485: boards: sabre-6quad: Add -fno-common to Make.defs
Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #5485:
URL: https://github.com/apache/incubator-nuttx/pull/5485#issuecomment-1038665127
>Hmm, I don't know why the Build / macOS (macos) failed.
My local build without this PR also fails.
--
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] masayuki2009 commented on pull request #5485: boards: sabre-6quad: Add -fno-common to Make.defs
Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #5485:
URL: https://github.com/apache/incubator-nuttx/pull/5485#issuecomment-1038684480
@Ouss4 @gustavonihei
Do you know what is happening to the latest esp32c3-devkit:wapi build?
--
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] xiaoxiang781216 commented on a change in pull request #5485: boards: sabre-6quad: Add -fno-common to Make.defs
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5485:
URL: https://github.com/apache/incubator-nuttx/pull/5485#discussion_r806405475
##########
File path: arch/arm/src/rtl8720c/Toolchain.defs
##########
@@ -50,8 +50,8 @@ ifneq ($(CONFIG_ARMV8M_STACKCHECK),y)
endif
endif
-ARCHCFLAGS = -fno-builtin -march=armv8-m.main+dsp -mthumb -mfloat-abi=soft -D__thumb2__ -g -gdwarf-3 -Os -fno-tree-scev-cprop
-ARCHCXXFLAGS = -fno-builtin -nostdinc++ -std=c++11
+ARCHCFLAGS = -fno-builtin -march=armv8-m.main+dsp -mthumb -mfloat-abi=soft -D__thumb2__ -g -gdwarf-3 -Os -fno-tree-scev-cprop -fno-common
Review comment:
The library generate with/without -fno-common mayn't link together. So, I think it's better to fix the selection.
--
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] xiaoxiang781216 commented on a change in pull request #5485: boards: sabre-6quad: Add -fno-common to Make.defs
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5485:
URL: https://github.com/apache/incubator-nuttx/pull/5485#discussion_r805468511
##########
File path: boards/arm/imx6/sabre-6quad/scripts/Make.defs
##########
@@ -45,6 +45,9 @@ ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef
ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10
+ARCHCFLAGS += -fno-common
+ARCHCXXFLAGS += -fno-common
Review comment:
merge to line 42-43
--
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] xiaoxiang781216 commented on pull request #5485: boards: sabre-6quad: Add -fno-common to Make.defs
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #5485:
URL: https://github.com/apache/incubator-nuttx/pull/5485#issuecomment-1039826690
--
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] xiaoxiang781216 commented on a change in pull request #5485: boards: sabre-6quad: Add -fno-common to Make.defs
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5485:
URL: https://github.com/apache/incubator-nuttx/pull/5485#discussion_r805480356
##########
File path: boards/arm/imx6/sabre-6quad/scripts/Make.defs
##########
@@ -39,8 +39,8 @@ ifneq ($(CONFIG_DEBUG_NOOPT),y)
endif
ARCHCPUFLAGS = -mcpu=cortex-a9 -mfpu=vfpv4-d16
-ARCHCFLAGS = -fno-builtin -ffunction-sections -fdata-sections
-ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fcheck-new -fno-rtti
+ARCHCFLAGS = -fno-builtin -ffunction-sections -fdata-sections -fno-common
Review comment:
After checking other Make.defs, it look like the better place is add -fno-common to CELFFLAGS/CXXELFFLAGS.
--
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] xiaoxiang781216 commented on a change in pull request #5485: boards: sabre-6quad: Add -fno-common to Make.defs
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5485:
URL: https://github.com/apache/incubator-nuttx/pull/5485#discussion_r805492565
##########
File path: boards/arm/imx6/sabre-6quad/scripts/Make.defs
##########
@@ -39,8 +39,8 @@ ifneq ($(CONFIG_DEBUG_NOOPT),y)
endif
ARCHCPUFLAGS = -mcpu=cortex-a9 -mfpu=vfpv4-d16
-ARCHCFLAGS = -fno-builtin -ffunction-sections -fdata-sections
-ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fcheck-new -fno-rtti
+ARCHCFLAGS = -fno-builtin -ffunction-sections -fdata-sections -fno-common
Review comment:
It look the better fix is add -fno-common to all ARCHCPUFLAGS/ARCHCXXFLAGS and remove from CELFFLAGS/CXXELFFLAGS.
--
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] pkarashchenko commented on a change in pull request #5485: boards: sabre-6quad: Add -fno-common to Make.defs
Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5485:
URL: https://github.com/apache/incubator-nuttx/pull/5485#discussion_r806135123
##########
File path: arch/arm/src/rtl8720c/Toolchain.defs
##########
@@ -50,8 +50,8 @@ ifneq ($(CONFIG_ARMV8M_STACKCHECK),y)
endif
endif
-ARCHCFLAGS = -fno-builtin -march=armv8-m.main+dsp -mthumb -mfloat-abi=soft -D__thumb2__ -g -gdwarf-3 -Os -fno-tree-scev-cprop
-ARCHCXXFLAGS = -fno-builtin -nostdinc++ -std=c++11
+ARCHCFLAGS = -fno-builtin -march=armv8-m.main+dsp -mthumb -mfloat-abi=soft -D__thumb2__ -g -gdwarf-3 -Os -fno-tree-scev-cprop -fno-common
Review comment:
IMO it is good to group `-fno-common` with `-ffunction-sections -fdata-sections`
##########
File path: arch/arm/src/rtl8720c/Toolchain.defs
##########
@@ -50,8 +50,8 @@ ifneq ($(CONFIG_ARMV8M_STACKCHECK),y)
endif
endif
-ARCHCFLAGS = -fno-builtin -march=armv8-m.main+dsp -mthumb -mfloat-abi=soft -D__thumb2__ -g -gdwarf-3 -Os -fno-tree-scev-cprop
-ARCHCXXFLAGS = -fno-builtin -nostdinc++ -std=c++11
+ARCHCFLAGS = -fno-builtin -march=armv8-m.main+dsp -mthumb -mfloat-abi=soft -D__thumb2__ -g -gdwarf-3 -Os -fno-tree-scev-cprop -fno-common
Review comment:
This is a point for discussion, but I think we should move `-fno-common` to `ARCHOPTIMIZATION`.
--
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] masayuki2009 commented on a change in pull request #5485: boards: sabre-6quad: Add -fno-common to Make.defs
Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on a change in pull request #5485:
URL: https://github.com/apache/incubator-nuttx/pull/5485#discussion_r805483079
##########
File path: boards/arm/imx6/sabre-6quad/scripts/Make.defs
##########
@@ -39,8 +39,8 @@ ifneq ($(CONFIG_DEBUG_NOOPT),y)
endif
ARCHCPUFLAGS = -mcpu=cortex-a9 -mfpu=vfpv4-d16
-ARCHCFLAGS = -fno-builtin -ffunction-sections -fdata-sections
-ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fcheck-new -fno-rtti
+ARCHCFLAGS = -fno-builtin -ffunction-sections -fdata-sections -fno-common
Review comment:
> After checking other Make.defs, it look like the better place is add -fno-common to CELFFLAGS/CXXELFFLAGS.
@xiaoxiang781216
I found that adding -fno-common to CELFFLAGS/CXXELFFLAGS does not work with CONFIG_BUILD_KERNEL=y.
--
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] xiaoxiang781216 commented on pull request #5485: boards: sabre-6quad: Add -fno-common to Make.defs
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #5485:
URL: https://github.com/apache/incubator-nuttx/pull/5485#issuecomment-1046128497
> Hmm, I don't know why the Build / macOS (macos) failed.
>
> ```
> ====================================================================================
> Configuration/Tool: esp32c3-devkit/wapi,CONFIG_RISCV_TOOLCHAIN_GNU_RVGL
> ------------------------------------------------------------------------------------
> Cleaning...
> Configuring...
> Disabling CONFIG_RISCV_TOOLCHAIN_GNU_RVGL
> Enabling CONFIG_RISCV_TOOLCHAIN_GNU_RVGL
> Building NuttX...
> % Total % Received % Xferd Average Speed Time Time Time Current
> Dload Upload Total Spent Left Speed
>
> 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
> 100 178 100 178 0 0 921 0 --:--:-- --:--:-- --:--:-- 946
>
> 100 367k 0 367k 0 0 685k 0 --:--:-- --:--:-- --:--:-- 685k
> 100 1897k 0 1897k 0 0 1273k 0 --:--:-- 0:00:01 --:--:-- 1601k
> 100 5862k 0 5862k 0 0 2219k 0 --:--:-- 0:00:02 --:--:-- 2610k
> 100 9992k 0 9992k 0 0 3570k 0 --:--:-- 0:00:02 --:--:-- 4255k
> riscv64-unknown-elf-ld: /Users/runner/work/incubator-nuttx/incubator-nuttx/sources/nuttx/staging/libarch.a(esp32c3_wifi_utils.o):(.rodata.g_wifi_default_mesh_crypto_funcs+0x0): multiple definition of `g_wifi_default_mesh_crypto_funcs'; /Users/runner/work/incubator-nuttx/incubator-nuttx/sources/nuttx/staging/libarch.a(esp32c3_wlan.o):(.rodata.g_wifi_default_mesh_crypto_funcs+0x0): first defined here
> riscv64-unknown-elf-ld: /Users/runner/work/incubator-nuttx/incubator-nuttx/sources/nuttx/staging/libarch.a(esp32c3_wifi_utils.o):(.rodata.g_wifi_default_wpa_crypto_funcs+0x0): multiple definition of `g_wifi_default_wpa_crypto_funcs'; /Users/runner/work/incubator-nuttx/incubator-nuttx/sources/nuttx/staging/libarch.a(esp32c3_wlan.o):(.rodata.g_wifi_default_wpa_crypto_funcs+0x0): first defined here
> riscv64-unknown-elf-ld: /Users/runner/work/incubator-nuttx/incubator-nuttx/sources/nuttx/staging/libarch.a(esp32c3_wifi_adapter.o):(.rodata.g_wifi_default_mesh_crypto_funcs+0x0): multiple definition of `g_wifi_default_mesh_crypto_funcs'; /Users/runner/work/incubator-nuttx/incubator-nuttx/sources/nuttx/staging/libarch.a(esp32c3_wlan.o):(.rodata.g_wifi_default_mesh_crypto_funcs+0x0): first defined here
> riscv64-unknown-elf-ld: /Users/runner/work/incubator-nuttx/incubator-nuttx/sources/nuttx/staging/libarch.a(esp32c3_wifi_adapter.o): in function `.LANCHOR13':
> esp32c3_wifi_adapter.c:(.rodata.g_wifi_default_wpa_crypto_funcs+0x0): multiple definition of `g_wifi_default_wpa_crypto_funcs'; /Users/runner/work/incubator-nuttx/incubator-nuttx/sources/nuttx/staging/libarch.a(esp32c3_wlan.o):(.rodata.g_wifi_default_wpa_crypto_funcs+0x0): first defined here
> riscv64-unknown-elf-ld: /Users/runner/work/incubator-nuttx/incubator-nuttx/sources/nuttx/staging/libarch.a(esp32c3_wireless.o):(.rodata.g_wifi_default_mesh_crypto_funcs+0x0): multiple definition of `g_wifi_default_mesh_crypto_funcs'; /Users/runner/work/incubator-nuttx/incubator-nuttx/sources/nuttx/staging/libarch.a(esp32c3_wlan.o):(.rodata.g_wifi_default_mesh_crypto_funcs+0x0): first defined here
> riscv64-unknown-elf-ld: /Users/runner/work/incubator-nuttx/incubator-nuttx/sources/nuttx/staging/libarch.a(esp32c3_wireless.o):(.rodata.g_wifi_default_wpa_crypto_funcs+0x0): multiple definition of `g_wifi_default_wpa_crypto_funcs'; /Users/runner/work/incubator-nuttx/incubator-nuttx/sources/nuttx/staging/libarch.a(esp32c3_wlan.o):(.rodata.g_wifi_default_wpa_crypto_funcs+0x0): first defined here
> make[1]: *** [nuttx] Error 1
> make: *** [nuttx] Error 2
> make: Target `all' not remade because of errors.
> /Users/runner/work/incubator-nuttx/incubator-nuttx/sources/nuttx/tools/testbuild.sh: line 252: /Users/runner/work/incubator-nuttx/incubator-nuttx/sources/nuttx/../nuttx/nuttx.manifest: No such file or director
> ```
This patch may fix this link error:
https://github.com/espressif/esp-wireless-drivers-3rdparty/pull/1
@Ouss4 please take a look.
--
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] masayuki2009 commented on pull request #5485: boards: sabre-6quad: Add -fno-common to Make.defs
Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #5485:
URL: https://github.com/apache/incubator-nuttx/pull/5485#issuecomment-1038660562
Hmm, I don't know why the Build / macOS (macos) failed.
```
====================================================================================
Configuration/Tool: esp32c3-devkit/wapi,CONFIG_RISCV_TOOLCHAIN_GNU_RVGL
------------------------------------------------------------------------------------
Cleaning...
Configuring...
Disabling CONFIG_RISCV_TOOLCHAIN_GNU_RVGL
Enabling CONFIG_RISCV_TOOLCHAIN_GNU_RVGL
Building NuttX...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 178 100 178 0 0 921 0 --:--:-- --:--:-- --:--:-- 946
100 367k 0 367k 0 0 685k 0 --:--:-- --:--:-- --:--:-- 685k
100 1897k 0 1897k 0 0 1273k 0 --:--:-- 0:00:01 --:--:-- 1601k
100 5862k 0 5862k 0 0 2219k 0 --:--:-- 0:00:02 --:--:-- 2610k
100 9992k 0 9992k 0 0 3570k 0 --:--:-- 0:00:02 --:--:-- 4255k
riscv64-unknown-elf-ld: /Users/runner/work/incubator-nuttx/incubator-nuttx/sources/nuttx/staging/libarch.a(esp32c3_wifi_utils.o):(.rodata.g_wifi_default_mesh_crypto_funcs+0x0): multiple definition of `g_wifi_default_mesh_crypto_funcs'; /Users/runner/work/incubator-nuttx/incubator-nuttx/sources/nuttx/staging/libarch.a(esp32c3_wlan.o):(.rodata.g_wifi_default_mesh_crypto_funcs+0x0): first defined here
riscv64-unknown-elf-ld: /Users/runner/work/incubator-nuttx/incubator-nuttx/sources/nuttx/staging/libarch.a(esp32c3_wifi_utils.o):(.rodata.g_wifi_default_wpa_crypto_funcs+0x0): multiple definition of `g_wifi_default_wpa_crypto_funcs'; /Users/runner/work/incubator-nuttx/incubator-nuttx/sources/nuttx/staging/libarch.a(esp32c3_wlan.o):(.rodata.g_wifi_default_wpa_crypto_funcs+0x0): first defined here
riscv64-unknown-elf-ld: /Users/runner/work/incubator-nuttx/incubator-nuttx/sources/nuttx/staging/libarch.a(esp32c3_wifi_adapter.o):(.rodata.g_wifi_default_mesh_crypto_funcs+0x0): multiple definition of `g_wifi_default_mesh_crypto_funcs'; /Users/runner/work/incubator-nuttx/incubator-nuttx/sources/nuttx/staging/libarch.a(esp32c3_wlan.o):(.rodata.g_wifi_default_mesh_crypto_funcs+0x0): first defined here
riscv64-unknown-elf-ld: /Users/runner/work/incubator-nuttx/incubator-nuttx/sources/nuttx/staging/libarch.a(esp32c3_wifi_adapter.o): in function `.LANCHOR13':
esp32c3_wifi_adapter.c:(.rodata.g_wifi_default_wpa_crypto_funcs+0x0): multiple definition of `g_wifi_default_wpa_crypto_funcs'; /Users/runner/work/incubator-nuttx/incubator-nuttx/sources/nuttx/staging/libarch.a(esp32c3_wlan.o):(.rodata.g_wifi_default_wpa_crypto_funcs+0x0): first defined here
riscv64-unknown-elf-ld: /Users/runner/work/incubator-nuttx/incubator-nuttx/sources/nuttx/staging/libarch.a(esp32c3_wireless.o):(.rodata.g_wifi_default_mesh_crypto_funcs+0x0): multiple definition of `g_wifi_default_mesh_crypto_funcs'; /Users/runner/work/incubator-nuttx/incubator-nuttx/sources/nuttx/staging/libarch.a(esp32c3_wlan.o):(.rodata.g_wifi_default_mesh_crypto_funcs+0x0): first defined here
riscv64-unknown-elf-ld: /Users/runner/work/incubator-nuttx/incubator-nuttx/sources/nuttx/staging/libarch.a(esp32c3_wireless.o):(.rodata.g_wifi_default_wpa_crypto_funcs+0x0): multiple definition of `g_wifi_default_wpa_crypto_funcs'; /Users/runner/work/incubator-nuttx/incubator-nuttx/sources/nuttx/staging/libarch.a(esp32c3_wlan.o):(.rodata.g_wifi_default_wpa_crypto_funcs+0x0): first defined here
make[1]: *** [nuttx] Error 1
make: *** [nuttx] Error 2
make: Target `all' not remade because of errors.
/Users/runner/work/incubator-nuttx/incubator-nuttx/sources/nuttx/tools/testbuild.sh: line 252: /Users/runner/work/incubator-nuttx/incubator-nuttx/sources/nuttx/../nuttx/nuttx.manifest: No such file or director
```
--
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] xiaoxiang781216 commented on a change in pull request #5485: boards: sabre-6quad: Add -fno-common to Make.defs
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5485:
URL: https://github.com/apache/incubator-nuttx/pull/5485#discussion_r806405475
##########
File path: arch/arm/src/rtl8720c/Toolchain.defs
##########
@@ -50,8 +50,8 @@ ifneq ($(CONFIG_ARMV8M_STACKCHECK),y)
endif
endif
-ARCHCFLAGS = -fno-builtin -march=armv8-m.main+dsp -mthumb -mfloat-abi=soft -D__thumb2__ -g -gdwarf-3 -Os -fno-tree-scev-cprop
-ARCHCXXFLAGS = -fno-builtin -nostdinc++ -std=c++11
+ARCHCFLAGS = -fno-builtin -march=armv8-m.main+dsp -mthumb -mfloat-abi=soft -D__thumb2__ -g -gdwarf-3 -Os -fno-tree-scev-cprop -fno-common
Review comment:
The library generate with/without -fno-common mayn't link together. So, I think it's better to fix the selection.
--
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] masayuki2009 commented on pull request #5485: boards: sabre-6quad: Add -fno-common to Make.defs
Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #5485:
URL: https://github.com/apache/incubator-nuttx/pull/5485#issuecomment-1039673417
>I don't know if the libraries are built with -fcommon.
@Ouss4
I understand.
@xiaoxiang781216
Let me exclude esp32c3-devkit.
--
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