GCC CPU optimization flags on packages

2 posts / 0 new
Last post
#1 Fri, 2016-06-10 02:33
WebDev
  • WebDev's picture
  • Offline
  • Last seen: 2 months 3 weeks ago
  • Joined: 2016-04-30

Hi all,

Where can I see the gcc compiler flags that are used to build applications in the apk repo?

For example, looking at the latest nginx build log for x86-64, I can't find anything that looks like the gcc flags.

The compiler flags I'm looking for are the CPU flags that trigger support for different SIMD instruction sets (e.g. mno-sse4.2). Many of them are listed here: https://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/i386-and-x86_002d64-Options.html#i386-and-x86_002d64-Options

And Intel describes their use in gcc here: https://software.intel.com/en-us/blogs/2012/09/26/gcc-x86-performance-hints

These flags can produce significant performance improvements for many applications, and since I know what hardware my production server will have – i.e. what CPU instructions it will support – I wanted to optimize. I could try building nginx myself. Am I correct that alpine applications need to be compiled by gcc, but using musl as the libc? I've never done this before, but it might be fun! I didn't see much about compiling in the docs or wiki. I see "build" here and there, but there's no mention of a compiler in those sections. I'm hazy on whether building a package is the same as compiling it in this context. (On Windows, we tend to use the terms interchangeably, but mostly I'm used to compile, not build.)

Thanks.

Sun, 2016-06-12 23:34
AmatCoder
  • AmatCoder's picture
  • Offline
  • Last seen: 1 year 4 months ago
  • Joined: 2013-10-18

Default flags are defined into /etc/abuild.conf file from abuild package.
You can look at it here.

Log in or register to post comments