Skip to content

Conversation

@abrodkin
Copy link
Member

@abrodkin abrodkin commented Nov 24, 2023

Inspired by picolibc/picolibc@7c9e9c3

As per Keth Packard:

These are provided by the compiler and shouldn't be replaced with our versions."

And indeed, an attempt to use these Newlib's headers with Clang-based compilers lead to compilation error:

clang -c test.c -I.../newlib/install/arc/include
test.c:8:14: error: '__builtin_choose_expr' requires a constant expression
        f1 = acos(f);
             ^~~~~~~
.../newlib/install/arc/include/tgmath.h:111:20: note: expanded from macro 'acos'
                                ^~~~~~~~~~~~~~~~~~~~
.../newlib/install/arc/include/tgmath.h:107:2: note: expanded from macro '__tg_full'
        __tg_impl_full(__x, __x, __x, __fn, __fn##f, __fn##l, c##__fn, c##__fn##f, c##__fn##l, __x)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../newlib/install/arc/include/tgmath.h:96:6: note: expanded from macro '__tg_impl_full'
            __tg_impl_simple(__x, __y, __z, __cfn, __cfnf, __cfnl, __VA_ARGS__),        \
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../newlib/install/arc/include/tgmath.h:86:3: note: expanded from macro '__tg_impl_simple'
                __tg_type_corr(x, y, z, double) || __tg_integer(x, y, z),\
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../newlib/install/arc/include/tgmath.h:71:2: note: expanded from macro '__tg_type_corr'
        (__tg_type3(__e1, __e2, __e3, __t) ||                           \
        ^
1 error generated.

Fixes foss-for-synopsys-dwc-arc-processors/toolchain#584

Inspired by picolibc/picolibc@7c9e9c3

As per Keth Packard: "These are provided by the compiler and
shouldn't be replaced with our versions."

And indeed, an attempt to use these Newlib's headers with Clang-based compilers
lead to compilation error:
---------------------->8---------------------
clang -c test.c -I.../newlib/install/arc/include
test.c:8:14: error: '__builtin_choose_expr' requires a constant expression
        f1 = acos(f);
             ^~~~~~~
.../newlib/install/arc/include/tgmath.h:111:20: note: expanded from macro 'acos'
                                ^~~~~~~~~~~~~~~~~~~~
.../newlib/install/arc/include/tgmath.h:107:2: note: expanded from macro '__tg_full'
        __tg_impl_full(__x, __x, __x, __fn, __fn##f, __fn##l, c##__fn, c##__fn##f, c##__fn##l, __x)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../newlib/install/arc/include/tgmath.h:96:6: note: expanded from macro '__tg_impl_full'
            __tg_impl_simple(__x, __y, __z, __cfn, __cfnf, __cfnl, __VA_ARGS__),        \
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../newlib/install/arc/include/tgmath.h:86:3: note: expanded from macro '__tg_impl_simple'
                __tg_type_corr(x, y, z, double) || __tg_integer(x, y, z),\
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../newlib/install/arc/include/tgmath.h:71:2: note: expanded from macro '__tg_type_corr'
        (__tg_type3(__e1, __e2, __e3, __t) ||                           \
        ^
1 error generated.
---------------------->8---------------------

See foss-for-synopsys-dwc-arc-processors/toolchain#584

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
@abrodkin abrodkin requested a review from claziss November 24, 2023 15:18
@claziss
Copy link
Contributor

claziss commented Nov 27, 2023

I have mix feelings about this. Are we trying to stay close to whatever Newlib is releasing, or are we forking it to a new "newlib"?

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.

3 participants