Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove math code for newlib #11

Merged
merged 3 commits into from
Jan 14, 2013

Conversation

grissiom
Copy link
Member

Newlib already have optimized and full featured math implementation. To
use it, one should add:

env['LIBS'] = ['m']

or equivalent to the SConstruct.

Newlib already have optimized and full featured math implementation. To
use it, one should add:

    env['LIBS'] = ['m']

or equivalent to the SConstruct.
@BernardXiong
Copy link
Member

Please provide more generic method to add the math library. Or add it on SConscript of minilibc directly.

@grissiom
Copy link
Member Author

Hmm, you mean removing the math in minilibc as well?

@BernardXiong
Copy link
Member

I made a mistaken. No modification in minilibc. It's newlib.

After remove math.c, we should point out how to add math library clearly, such as add it in SConscript file of newlib etc. Or we could add it in SConscript directly. If program does not use functions in math library, is the math library removed when linking? We should verify it or provide a good method and not only said '''env['LIBS'] = ['m']'''.

libm is a frequently used lib. Newlib is compiled with
-ffunction-sections in recent GCC tool chains. The linker would just
link in the functions that have been referenced. So setting this won't
result in bigger text size.
@grissiom
Copy link
Member Author

I've tested both with and without --gc-sections and it seems that link with recent tool chain(4.7_2012q4) won't pour all the libm symbols into the text. So if the program did not use any math functions, it math lib would eliminate eventually. I think it's safe to set Env['LIBS'] = ['m'] here.

My commit 8ad1205 fixed this.

@grissiom
Copy link
Member Author

OK, I've updated this branch with taking advantage of DefineGroup. I think it is getting ready for merging.

Merging this branch will merge all the three commits. If you have any problem, feel free to comment ;)

BernardXiong added a commit that referenced this pull request Jan 14, 2013
@BernardXiong BernardXiong merged commit 7a8dfb6 into RT-Thread:master Jan 14, 2013
BernardXiong pushed a commit that referenced this pull request Jan 17, 2021
supperthomas added a commit that referenced this pull request May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants