LFS 13.0

Scripts

/etc/profile.d/build-default-flags.sh /etc/flags-store/toggle-flags.sh #!/usr/bin/env bash

FLAG_DIR=“/etc/flags-store”

GREEN='\033[0;32m' YELLOW='\033[1;33m' CYAN='\033[0;36m' NC='\033[0m'

if [ ! -d “$FLAG_DIR” ]; then

echo -e "${YELLOW}경고: 플래그 디렉터리($FLAG_DIR)가 존재하지 않습니다.${NC}"
echo -e "정보: 플래그 디렉터리($FLAG_DIR)를 생성합니다."
mkdir -pv $FLAG_DIR
echo -e "${GREEN}정보: 기본 플래그 파일을 생성합니다.${NC}"
echo -e '#Basic C, CXX and LD Flags. (native,O3,pipe)\nCOMMON_FLAGS="-march=native -O3 -pipe"\nexport CFLAGS="${COMMON_FLAGS}"\nexport CXXFLAGS="${COMMON_FLAGS}"\nexport FCFLAGS="${COMMON_FLAGS}"\nexport FFLAGS="${COMMON_FLAGS}"\nexport RUSTFLAGS="-C target-cpu=native -C opt-level=3"\n\nexport LDFLAGS="-Wl,-O1 -Wl,--as-needed"' | tee ${FLAG_DIR}/safe.flags
echo -e "${NC}"

fi

mapfile -t FLAG_FILES < <(ls “$FLAG_DIR”/*.flags 2>/dev/null)

echo -e “${CYAN}==============================================${NC}” echo -e “ 현재 적용된 CFLAGS: ${GREEN}${CFLAGS:-“None”}${NC}” echo -e “———————————————-” echo -e “ 사용 가능한 플래그 목록:”

for i in “${!FLAG_FILES[@]}”; do

filename=$(basename "${FLAG_FILES[$i]}")
description=$(head -n 1 "${FLAG_FILES[$i]}" | sed 's/^#//g' | xargs)
echo -e " $((i+1))) ${YELLOW}${filename%-6}${NC} \t- ${CYAN}${description}${NC}"

done

echo -e “ c) ${GREEN}Clear-Flags${NC} (Unset all)” echo -e “ q) Quit” echo -e “———————————————-”

read -p “ 플래그 번호를 선택하십시오: ” choice

if "$choice" == "q"; then

echo "취소되었습니다."

elif "$choice" == "c"; then

unset CFLAGS CXXFLAGS FCFLAGS FFLAGS RUSTFLAGS LDFLAGS MAKEFLAGS COMMON_FLAGS
echo -e "${GREEN}>>> 모든 플래그가 초기화되었습니다.${NC}"

elif "$choice" =~ ^[0-9]+$ && [ “$choice” -ge 1 ] && [ “$choice” -le “${#FLAG_FILES[@]}” ]; then

selected_file="${FLAG_FILES[$((choice-1))]}"
source "$selected_file"
echo -e "${GREEN}>>> [$(basename "$selected_file")] 적용 완료!${NC}"

else

echo -e "${RED}잘못된 선택입니다.${NC}"

fi

unset FLAG_DIR FLAG_FILES

export MAKEFLAGS=“-j$(nproc)” alias clear-flags='unset CFLAGS CXXFLAGS FCFLAGS FFLAGS RUSTFLAGS LDFLAGS MAKEFLAGS' </codeprism> /etc/flags-store/01-safe.flag /etc/flag-store/02-lto.flags /etc/flags-store/03-graphite.flags /etc/flags-store/04-kernel.flags /etc/flags-store/99-debug.flags

Optimize Failed Package

Glibc: LTO-x (safe: -march=native -O3 -pipe)

TCL: LTO-x (safe: -march=native -O3 -pipe)

libtool: LTO-x (safe: -march=native -O3 -pipe)

OpenSSL: LTO-x (safe: -march=native -O3 -pipe)

Linux-6.18.10: LTO-x, O3-x (safe: -march=native -O2 -pipe)

Chapter 8.30. GCC-15.2.0

BLFS 13.0

BLFS Build Order

Chapter 11. General Utilities

pinentry-1.3.2