public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Joel Sherrill <joel.sherrill@oarcorp.com>
To: Gedare Bloom <gedare@rtems.org>, aditya upadhyay <aadit0402@gmail.com>
Cc: "newlib@sourceware.org" <newlib@sourceware.org>
Subject: Re: Work on newlib
Date: Tue, 16 May 2017 16:12:00 -0000	[thread overview]
Message-ID: <eb2902be-b2c3-f1c9-c8eb-2f5d43dab0de@oarcorp.com> (raw)
In-Reply-To: <CAC82fA2rO71bitv_UQ7gJqfreejYOs_j+qOMLn6X+P=o4uNEfw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3144 bytes --]

Can't blame anyone but me for j-newlib. It is attached.

On 5/16/2017 10:53 AM, Gedare Bloom wrote:
> On Tue, May 16, 2017 at 2:56 AM, aditya upadhyay <aadit0402@gmail.com> wrote:
>> Hello Developers,
>>
>> I am Aditya Upadhyay got selected in Google Summer of Code(2017) for RTEMS
>> organization. My Proposal has been accepted for POSIX Compliance, Where I
>> have to work on newlib and some libraries that is not in RTEMS, have to
>> implement.
>>
>> I am having a j-newlib script pointed by Joel Sherrill, I have used this
>> script using following command :
>>  aditya@aditya-Lenovo-ideapad-110-15ACL:~/development/newlib$ ./j-newlib
>> These are the targets in j-newlib :
>>  # primary targets
>>   TARGETS="${TARGETS} sparc-rtems4.12"
>>   TARGETS="${TARGETS} arm-rtems4.12"
>>   TARGETS="${TARGETS} powerpc-rtems4.12"
>>   TARGETS="${TARGETS} mips-rtems4.12"
>>   TARGETS="${TARGETS} i386-rtems4.12"
>>   TARGETS="${TARGETS} m68k-rtems4.12"
>>
>> There are some secondary and optimistic targets.
>>
>> and generated directory like b-sparc64-rtems4.12-newlib,
>> b-sparc-rtems4.12-newlib, b-arm-rtems4.12-newlib etc..but there is not a
>> single .exe file after i fired make command.
>>
>> I do not know whether i am going in right working direction or not ?
>> Please correct me. Any direction or suggestion will be greatly appreciable.
>>
> Without knowing what this j-newlib script does, it is hard to help you
> interpret the output. Perhaps Joel can help you. For RTEMS, you should
> compile newlib as part of building gcc. This means if you have
> modified newlib you should re-compile gcc with it, and then you would
> re-compile RTEMS and run its testsuite in order to test your changes.

I developed j-newlib to speed up the cycle when modifying newlib.
I don't build every target with it. That's the job of the RTEMS
Source Builder. I use it to build a **SINGLE** target and test
a change to newlib.

Once I get the patch tested and into shape, I submit it upstream
and add it to the RSB.

NOTE: j-newlib may be using --disable-multilib which is wrong
in general but OK for testing on sparc-rtems with erc32. But since
most of newlib is in C, that's enough testing to have confidence
in most cases that it is time to move on to integrating the patch
into the RSB and upstream newlib.

> To compile a modified newlib into the gcc toolchain, you should
> consider creating a patch of your change to newlib (e.g. from
> git-format-patch) and add the patch to your local rtems-source-builder
> in order to apply a custom patch during the compiler re-build. See
> https://docs.rtems.org/branches/master/rsb.html#patches for some
> documentation on how you do this, which includes an example
> specifically related to patching newlib.

That's the full path that must be done. j-newlib just makes it
quicker to iterate on debugging newlib.

> Gedare
>
>> Thanks & Best Regards,
>> Aditya Upadhyay

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill@OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35806
Support Available                (256) 722-9985

[-- Attachment #2: j-newlib --]
[-- Type: text/plain, Size: 2327 bytes --]

#! /bin/sh
#

TARGETS=""
if [ $# -ne 0 ] ; then
  TARGETS="$*"
else
  # primary targets
  TARGETS="${TARGETS} sparc-rtems4.12"
  TARGETS="${TARGETS} arm-rtems4.12"
  TARGETS="${TARGETS} powerpc-rtems4.12"
  TARGETS="${TARGETS} mips-rtems4.12"
  TARGETS="${TARGETS} i386-rtems4.12"
  TARGETS="${TARGETS} m68k-rtems4.12"
  # secondary targets
  TARGETS="${TARGETS} bfin-rtems4.12"
  TARGETS="${TARGETS} h8300-rtems4.12"
  TARGETS="${TARGETS} lm32-rtems4.12"
  TARGETS="${TARGETS} m32c-rtems4.12"
  TARGETS="${TARGETS} moxie-rtems4.12"
  TARGETS="${TARGETS} nios2-rtems4.12"
  TARGETS="${TARGETS} or1k-rtems4.12"
  TARGETS="${TARGETS} sh-rtems4.12"
  TARGETS="${TARGETS} sparc64-rtems4.12"
  TARGETS="${TARGETS} v850-rtems4.12"
  # optimistic targets
  TARGETS="${TARGETS} aarch64-rtems4.12"
  TARGETS="${TARGETS} microblaze-rtems4.12"
  TARGETS="${TARGETS} x86_64-rtems4.12"
fi

NEWLIB=newlib-cygwin

if [ ! -d ${NEWLIB} ] ; then
  echo "no NEWLIB source present"
  exit 1
fi

PREFIX=/tmp/tools
#PREFIX=/users/joel/rtems-4.11-work/tools
BASEDIR=`pwd`
for target in ${TARGETS}
do
  # Best to avoid iconv on some targets
  case ${target} in
    avr*)   enable_iconv="--disable-iconv" ;;
    h8300*) enable_iconv="--disable-iconv" ;;
    m32c*)  enable_iconv="--disable-iconv --disable-libssp" ;;
    *)
      enable_iconv="--enable-newlib-iconv \
   --enable-newlib-iconv-encodings=big5,cp775,cp850,cp852,cp855,\
cp866,euc_jp,euc_kr,euc_tw,iso_8859_1,iso_8859_10,iso_8859_11,\
iso_8859_13,iso_8859_14,iso_8859_15,iso_8859_2,iso_8859_3,\
iso_8859_4,iso_8859_5,iso_8859_6,iso_8859_7,iso_8859_8,iso_8859_9,\
iso_ir_111,koi8_r,koi8_ru,koi8_u,koi8_uni,ucs_2,ucs_2_internal,\
ucs_2be,ucs_2le,ucs_4,ucs_4_internal,ucs_4be,ucs_4le,us_ascii,\
utf_16,utf_16be,utf_16le,utf_8,win_1250,win_1251,win_1252,\
win_1253,win_1254,win_1255,win_1256,win_1257,win_1258"
    ;;
  esac

  echo Building ${target}
  cd ${BASEDIR}
  rm -rf b-${target}-newlib
  mkdir b-${target}-newlib
  cd b-${target}-newlib
  ../${NEWLIB}/configure \
    --enable-multilib \
    ${enable_iconv} \
    --enable-newlib-io-c99-formats \
    --enable-threads \
    --target=${target} \
    --prefix=${PREFIX} >c.log 2>&1 && \
  make -j24 >b.log 2>&1 
  result=$?
  make install >i.log 2>&1
  #test $result -eq 0 && rm -rf ${BASEDIR}/b-${target}-newlib
  echo $?
done
exit 0

      reply	other threads:[~2017-05-16 16:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAMZxAxcdi5RX7PDOKU25aQKghG2DAPFHD4QSyd6vik_T=nOgMQ@mail.gmail.com>
2017-05-16 15:53 ` Gedare Bloom
2017-05-16 16:12   ` Joel Sherrill [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=eb2902be-b2c3-f1c9-c8eb-2f5d43dab0de@oarcorp.com \
    --to=joel.sherrill@oarcorp.com \
    --cc=aadit0402@gmail.com \
    --cc=gedare@rtems.org \
    --cc=newlib@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).