Project

General

Profile

Actions

Bug #5749

open

configure.ac: default CFLAGS, LT_INIT adds "-g -O2"

Added by fixeria over 1 year ago. Updated about 1 year ago.

Status:
New
Priority:
Normal
Assignee:
Target version:
-
Start date:
11/09/2022
Due date:
% Done:

0%

Spec Reference:

Description

Today I spent quite some time trying to figure out why am I seeing -g -O2 present in CFLAGS by default when building some projects. As it turned out, it's the LT_INIT (called in configure.ac) adding -g -O2 to CFLAGS if they're empty. I could not find anything in documentation describing this behavior. The problem is that this behavior is inconsistent across the Osmocom projects: for some you get empty CFLAGS by default, for some you get CFLAGS=-g -O2. Most likely this inconsistency was introduced when we started to specify the -std=gnu11 explicitly: in some projects (e.g. libosmocore.git, libosmo-abis.git, osmo-bsc) we set CFLAGS before calling the LT_INIT, in some (osmo-hlr, osmo-iuh, osmo-sgsn) after.

We need to decide on whether we want to have empty CFLAGS or CFLAGS=-g -O2 set by default. Personally I prefer the former approach, because explicit is better then implicit. Hoernchen also prefers the former and does not want "magical flags out of nowhere". Either way, the default behavior should be consistent across all Osmocom projects. laforge what do you think?

Actions #1

Updated by laforge about 1 year ago

  • Assignee changed from laforge to fixeria

I don't really have a strong preference either way anymore. The most important part is probably to have consistency across osmo-* projects. No magic flags is probably a good idea.

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)