access-softek / llvm-project

Other
0 stars 0 forks source link

[meta] Make newlib work with current MSP430 LLVM #15

Closed atrosinenko closed 11 months ago

atrosinenko commented 4 years ago

When compiling master branch of mainline newlib taken from git://sourceware.org/git/newlib-cygwin.git, some errors occurred:

With the following patch applied, I have compiled it successfully:

diff --git a/newlib/configure.host b/newlib/configure.host
index a84c0c80a..8cbf50eb3 100644
--- a/newlib/configure.host
+++ b/newlib/configure.host
@@ -263,7 +263,7 @@ case "${host_cpu}" in
   msp430*)
        newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED -DSMALL_MEMORY"
        newlib_cflags="${newlib_cflags} -ffunction-sections -fdata-sections "
-       newlib_cflags="${newlib_cflags} -mOs "
+#      newlib_cflags="${newlib_cflags} -mOs "
        newlib_cflags="${newlib_cflags} -mhwmult=none "
        machine_dir=msp430
        default_newlib_nano_malloc="yes"
diff --git a/newlib/libm/common/lrintl.c b/newlib/libm/common/lrintl.c
index 67c46384a..21cb90c14 100644
--- a/newlib/libm/common/lrintl.c
+++ b/newlib/libm/common/lrintl.c
@@ -36,7 +36,7 @@ POSSIBILITY OF SUCH DAMAGE.
 long int
 lrintl (long double x)
 {
-  return lrint(x);
+  return 0 /*lrint(x)*/;
 }
 #endif

diff --git a/newlib/libm/common/lroundl.c b/newlib/libm/common/lroundl.c
index 868752292..536a90b74 100644
--- a/newlib/libm/common/lroundl.c
+++ b/newlib/libm/common/lroundl.c
@@ -36,7 +36,7 @@ POSSIBILITY OF SUCH DAMAGE.
 long
 lroundl (long double x)
 {
-  return lround(x);
+  return 0 /*lround(x)*/;
 }
 #endif
atrosinenko commented 4 years ago

There exists identical issue access-softek/msp430-clang#11.