|
OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD. |
|
Thread Tools | Display Modes |
|
||||
kernel, userland, and ports CFLAGS
I just installed 5.6-i386 and I am Building the System from Source. The plan is to first build -release with the default settings, then build -release with the compiler aware of the target machine's CPU architecture, maybe:
CFLAGS="-march=native" CXXFLAGS="${CFLAGS}" or: CFLAGS="-march=prescott" CXXFLAGS="${CFLAGS}" If -release compiles smoothly then I will update and compile -stable. Not an efficient process, I know, but I find creeping up on the goal this way develops confidence (and the build automation is impressive, I like to watch it in action). So, what's the best way to set compiler flags (e.g., -march)? I haven't been able to find anything in the FAQ or man pages. Is there is a way to distinguish between the major regions of the system (kernel, userland, and ports) and set different flags for each? |
|
|||
Quote:
I have seen this debated countless times on misc@, & the result is always the same -- stay with that is written in release(8) & Section 5.3 of the FAQ. Quote:
As you get into building from scratch, you will find that it is a very time consuming process. I build -current on a regular basis, usually in response to new versions of specific applications I use being checked into the ports tree. I don't bother with a lot of "What if?" questions because I will be repeating the same process within a month. What you decide for yourself, is your choice, but the culture of this project generally states that going out on a limb needs to be done with grounded reasoning, & an understanding of what the repercussions will be. Straying from the norm is a choice you make; just don't expect the project developers to drop what they are doing to chase down any rabbit holes you may fall into. Be aware that if you ultimately submit bug reports into the project, they need to be done with full disclosure of any changes from the releases or snapshots found on the mirrors. Any changes not disclosed may result in a lot of wasted time, & blemish your reputation with the developers. The very first question they will ask is what behaviour is seen with the default kernel, userland, & ports without such exotic changes. And they are right in asking such. It saves a lot of time. Unless you have a specific reason to deviate from the defaults, don't do it. You are on your own if you do. Last edited by ocicat; 15th February 2015 at 12:13 AM. Reason: clarity |
|
||||
Quote:
Yep, and an appreciation of ingenuity and craftsmanship. |
|
||||
When building 3rd party applications from the ports(7) collection, I think I found a fairly straightforward way to inform the compiler of the CPU's capabilities.
bsd.port.mk(5) describes the VARIABLES: Code:
COPTS User settings. Supplementary options appended to ${CFLAGS} for building. Since most ports ignore the COPTS convention, they are actually told to use ${CFLAGS} ${COPTS} as CFLAGS. CXXOPTS User settings. Supplementary options appended to ${CXXFLAGS} for building. Code:
# Add any COPTS to CFLAGS. Note: programs that use imake do not # use CFLAGS! Also, many (most?) ports hard code CFLAGS, ignoring # what we pass in. .if defined(COPTS) CFLAGS += ${COPTS} .endif .if defined(CXXOPTS) CXXFLAGS += ${CXXOPTS} .endif Setting COPTS doesn't seem like a contradiction of the design. Rather, this seems to be the intended use. So, a little test: # cd /usr/ports/net/wget # make COPTS="-march=native" CXXOPTS="-march=native" # make install # make CLEANDEPENDS=Yes clean=all And it looks like wget and its dependencies were compiled with the -march=native flag. Huzzah! Last edited by hanzer; 15th February 2015 at 09:53 PM. |
|
||||
Interesting.
|
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Why to build a new userland? | batence | NetBSD Installation and Upgrading | 2 | 5th January 2015 07:44 PM |
how to determine if kernel & userland are synchronized? | daemonfowl | OpenBSD General | 4 | 10th May 2012 03:02 PM |
Chrooted Userland | Tommahawk | OpenBSD General | 3 | 23rd December 2010 12:01 AM |
userland sources | rex | FreeBSD General | 8 | 8th September 2008 12:33 AM |
building userland fails after upgrade to 7.0 | padmanabh | FreeBSD Installation and Upgrading | 10 | 22nd July 2008 05:18 AM |