Standard Library not built in release mode with -R in build script


(Ankit Agarwal) #1

Standard library is not built in release mode by default with -R flag in
build script. Is that intended behaviour?

Passing `--no-swift-stdlib-assertions --build-swift-static-stdlib
--swift-enable-ast-verifier=0` to build script created the build in folder
`Ninja-ReleaseAssert+stdlib-Release`

···

--
Ankit


(Dmitri Gribenko) #2

Release/debug flags control the optimization level. The assertions
are controlled with separate flags.

If you want to build the library for use in production, you need to
enable optimization and turn off assertions with two separate flags.

Dmitri

···

On Thu, Jul 21, 2016 at 8:35 AM, Ankit Agarwal via swift-dev <swift-dev@swift.org> wrote:

Standard library is not built in release mode by default with -R flag in
build script. Is that intended behaviour?

Passing `--no-swift-stdlib-assertions --build-swift-static-stdlib
--swift-enable-ast-verifier=0` to build script created the build in folder
`Ninja-ReleaseAssert+stdlib-Release`

--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr@gmail.com>*/


(Ankit Agarwal) #3

Got it, thanks!

···

On Thu, Jul 21, 2016 at 9:08 PM, Dmitri Gribenko <gribozavr@gmail.com> wrote:

On Thu, Jul 21, 2016 at 8:35 AM, Ankit Agarwal via swift-dev > <swift-dev@swift.org> wrote:
> Standard library is not built in release mode by default with -R flag in
> build script. Is that intended behaviour?
>
> Passing `--no-swift-stdlib-assertions --build-swift-static-stdlib
> --swift-enable-ast-verifier=0` to build script created the build in
folder
> `Ninja-ReleaseAssert+stdlib-Release`

Release/debug flags control the optimization level. The assertions
are controlled with separate flags.

If you want to build the library for use in production, you need to
enable optimization and turn off assertions with two separate flags.

Dmitri

--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr@gmail.com>*/

--
Ankit