LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1955|回复: 7

我把/static目录给删了,chroot时用这样一个命令行吗?

[复制链接]
发表于 2002-12-21 17:50:43 | 显示全部楼层 |阅读模式
chroot /mnt/lfs /bin/bash
发表于 2002-12-21 17:53:09 | 显示全部楼层
没有了/static后,chroot的命令要改一下,但是也不能像你的那么简单,下面是我在装BLFS时候的chroot:
chroot $LFS /usr/bin/env -i \
    HOME=/root TERM=$TERM PS1='\u:\w\$ ' \
    PATH=/bin:/usr/bin:/sbin:/usr/sbin \
    CC='gcc -s' \
    CHOST="i686-pc-linux-gnu" \
    CFLAGS="-march=pentium3 -O3 -pipe -fomit-frame-pointer -fforce-addr -falign-functions=4 -fprefetch-loop-arrays" \
    CXXFLAGS="-march=pentium3 -O3 -pipe -fomit-frame-pointer -fforce-addr -falign-functions=4 -fprefetch-loop-arrays" \
    /bin/bash --login

mount proc /proc -t proc
 楼主| 发表于 2002-12-21 17:55:29 | 显示全部楼层

那么我上面的命令。对LFS系统会不会有什么不良影响呢

CC='gcc -s' \
CHOST="i686-pc-linux-gnu" \
CFLAGS="-march=pentium3 -O3 -pipe -fomit-frame-pointer -fforce-addr -falign-functions=4 -fprefetch-loop-arrays" \
CXXFLAGS="-march=pentium3 -O3 -pipe -fomit-frame-pointer -fforce-addr -falign-functions=4 -fprefetch-loop-arrays
这几行可以不加吗?
发表于 2002-12-21 17:59:20 | 显示全部楼层
这几行是优化参数,你的CPU是?
改成你的CPU的就行了。我装LFS用的都是这样的优化参数,不同的CPU用的也不一样。有一个疯狂优化,还有一个安全优化,都不错的。
发表于 2002-12-21 18:00:55 | 显示全部楼层
Safe flags to use for gentoo-1.4


Those flags are for gcc-3.x and alike (mostly gcc-3.0, gcc-3.1.1 and gcc-3.2), you may check which gcc you're using with the following command :

How to know your gcc version

#gcc --version

You can know which CPU you have with the following command :

How to know your CPU type

cat /proc/cpuinfo

This page is for those who don't want to experiment, want a stable system, but still optimized for their processor. Be careful, by using those flags, binaries from your system might not work on another one. So if you compiled with those flags optimized for p4, you cant send a tbz2 or share a hard disk with a friend who only has a pentium MMX.

i386 (Intel), do you really want to install gentoo on that ?

CHOST="i386-pc-linux-gnu"
CFLAGS="-march=i386 -O3 -pipe -fomit-frame-pointer"
CXXFLAGS="-march=i386 -O3 -pipe -fomit-frame-pointer"

i486 (Intel), do you really want to install gentoo on that ?

CHOST="i486-pc-linux-gnu"
CFLAGS="-march=i486 -O3 -pipe -fomit-frame-pointer"
CXXFLAGS="-march=i486 -O3 -pipe -fomit-frame-pointer"

Pentium 1 (Intel)

CHOST="i586-pc-linux-gnu"
CFLAGS="-march=pentium -O3 -pipe -fomit-frame-pointer"
CXXFLAGS="-march=pentium -O3 -pipe -fomit-frame-pointer"

Pentium MMX (Intel)

CHOST="i586-pc-linux-gnu"
CFLAGS="-march=pentium-mmx -O3 -pipe -fomit-frame-pointer"
CXXFLAGS="-march=pentium-mmx -O3 -pipe -fomit-frame-pointer"

Pentium PRO (Intel)

CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentiumpro -O3 -pipe -fomit-frame-pointer"
CXXFLAGS="-march=pentiumpro -O3 -pipe -fomit-frame-pointer"

Pentium II (Intel)

CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium2 -O3 -pipe -fomit-frame-pointer"
CXXFLAGS="-march=pentium2 -O3 -pipe -fomit-frame-pointer"

Celeron (Mendocino), aka Celeron1 (Intel)

CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium2 -O3 -pipe -fomit-frame-pointer"
CXXFLAGS="-march=pentium2 -O3 -pipe -fomit-frame-pointer"

Pentium III (Intel)

CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium3 -O3 -pipe -fomit-frame-pointer"
CXXFLAGS="-march=pentium3 -O3 -pipe -fomit-frame-pointer"

Celeron (Coppermine) aka Celeron2 (Intel)

CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium3 -O3 -pipe -fomit-frame-pointer"
CXXFLAGS="-march=pentium3 -O3 -pipe -fomit-frame-pointer"

Celeron (Willamette?) (Intel)

CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer"
CXXFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer"

Pentium 4 (Intel)

CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer"
CXXFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer"

Eden C3/Ezra (Via)

CHOST="i586-pc-linux-gnu"
CFLAGS="-march=i586 -m3dnow -O3 -pipe -fomit-frame-pointer"
CXXFLAGS="-march=i586 -m3dnow -O3 -pipe -fomit-frame-pointer"

quote : the ezra doesn't have any special instructions that you could optimize for, just consider is a K6-3...basically a p2 with 3dnow

K6 (AMD)

CHOST="i586-pc-linux-gnu"
CFLAGS="-march=k6 -O3 -pipe -fomit-frame-pointer"
CXXFLAGS="-march=k6 -O3 -pipe -fomit-frame-pointer"

K6-2 (AMD)

CHOST="i586-pc-linux-gnu"
CFLAGS="-march=k6-2 -O3 -pipe -fomit-frame-pointer"
CXXFLAGS="-march=k6-2 -O3 -pipe -fomit-frame-pointer"

K6-3 (AMD)

CHOST="i586-pc-linux-gnu"
CFLAGS="-march=k6-3 -O3 -pipe -fomit-frame-pointer"
CXXFLAGS="-march=k6-3 -O3 -pipe -fomit-frame-pointer"

Athlon (AMD)

CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon -O3 -pipe -fomit-frame-pointer"
CXXFLAGS="-march=athlon -O3 -pipe -fomit-frame-pointer"

Athlon-tbird, aka K7 (AMD)

CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-tbird -O3 -pipe -fomit-frame-pointer"
CXXFLAGS="-march=athlon-tbird -O3 -pipe -fomit-frame-pointer"

Athlon-tbird XP (AMD)

CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer"
CXXFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer"

Athlon 4(AMD)

CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-4 -O3 -pipe -fomit-frame-pointer"
CXXFLAGS="-march=athlon-4 -O3 -pipe -fomit-frame-pointer"

Athlon XP (AMD)

CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer"
CXXFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer"

Athlon MP (AMD)

CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-mp -O3 -pipe -fomit-frame-pointer"
CXXFLAGS="-march=athlon-mp -O3 -pipe -fomit-frame-pointer"

603 (PowerPC)

CHOST="powerpc-unknown-linux-gnu"
CFLAGS="-O3 -pipe -fsigned-char -mpowerpc-gfxopt"
CXXFLAGS="-O3 -pipe -fsigned-char -mpowerpc-gfxopt"

603e (PowerPC)

CHOST="powerpc-unknown-linux-gnu"
CFLAGS="-O3 -pipe -fsigned-char -mpowerpc-gfxopt"
CXXFLAGS="-O3 -pipe -fsigned-char -mpowerpc-gfxopt"

604 (PowerPC)

CHOST="powerpc-unknown-linux-gnu"
CFLAGS="-O3 -pipe -fsigned-char -mpowerpc-gfxopt"
CXXFLAGS="-O3 -pipe -fsigned-char -mpowerpc-gfxopt"

604e (PowerPC)

CHOST="powerpc-unknown-linux-gnu"
CFLAGS="-O3 -pipe -fsigned-char -mpowerpc-gfxopt"
CXXFLAGS="-O3 -pipe -fsigned-char -mpowerpc-gfxopt"

750 aka as G3 (PowerPC)

CHOST="powerpc-unknown-linux-gnu"
CFLAGS="-mcpu=750 -O3 -pipe -fsigned-char -mpowerpc-gfxopt"
CXXFLAGS="-mcpu=750 -O3 -pipe -fsigned-char -mpowerpc-gfxopt"

Note: do not use -march=

7400, aka G4 (PowerPC)

CHOST="powerpc-unknown-linux-gnu"
CFLAGS="-mcpu=7400 -O2 -pipe -fsigned-char -maltivec
        -mabi=altivec -mpowerpc-gfxopt"
CXXFLAGS="-mcpu=7400 -O2 -pipe -fsigned-char -maltivec
        -mabi=altivec -mpowerpc-gfxopt"
   -fsigned-char -maltivec -mabi=altivec -mpowerpc-gfxopt"

Note: do not use -march=
Note: -O3 is unstable on G4

7450, aka G4 second generation (PowerPC)

CHOST="powerpc-unknown-linux-gnu"
CFLAGS="-mcpu=7450 -O2 -pipe -fsigned-char
        -maltivec -mabi=altivec -mpowerpc-gfxopt"
CXXFLAGS="-mcpu=7450 -O2 -pipe -fsigned-char
        -maltivec -mabi=altivec -mpowerpc-gfxopt"

Note: do not use -march=
Note: -O3 is unstable on G4

PowerPC (If you don't know which one)

CHOST="powerpc-unknown-linux-gnu"
CFLAGS="-O3 -pipe -fsigned-char -mpowerpc-gfxopt"
CXXFLAGS="-O3 -pipe -fsigned-char -mpowerpc-gfxopt"

Sparc

CHOST="sparc-unknown-linux-gnu"
CFLAGS="-O3 -pipe -fomit-frame-pointer"
CXXFLAGS="-O3 -pipe -fomit-frame-pointer"

Sparc 64

CHOST="sparc64-unknown-linux-gnu"
CFLAGS="-O3 -pipe -fomit-frame-pointer"
CXXFLAGS="-O3 -pipe -fomit-frame-pointer"
发表于 2002-12-21 18:01:32 | 显示全部楼层
Experimental flags to use for gentoo-1.4


Those flags are for gcc-3.x and alike (mostly gcc-3.0, gcc-3.1.1 and gcc-3.2), you may check which gcc you're using with the following command :

How to know your gcc version

#gcc --version

You can know which CPU you have with the following command :

How to know your CPU type

cat /proc/cpuinfo

Ok, you really want to optimize your box to death, even if that means spending times experimenting stuff, and sometimes breaking your box ? Eventually, the flags combination that prove stable here will go on the safe flag page If you can't see any line here, that means nobody has reported either success or failure with any flags... wanna test ? The first thing you want to test are the following flags (don't forget to add -pipe -O3 -march=XXX -fomit-frame-pointer, which is the bare minimum)

    * -fprefetch-loop-arrays
    * -ffast-math
    * -fforce-addr (-fforce-mem is implied by -O3)
    * -falign-functions=4
    * -funroll-loops ( bigger exe, maybe faster, usually not worth it, I don't use it)

The following flags have been reported to work with gentoo 1.4 (gcc-3.2). The CHOST is unrelated to compiler flags, you should use the exact same one as found on the safe flags page

note : -fstrict-aliasing -fexpensive-optimizations -force-mem -frerun-loop-opt -frerun-cse-after-loop are implied by -O3, see the FAQ

Pentium III (Intel)

CFLAGS="-march=pentium3 -O3 -pipe -fomit-frame-pointer
   -fforce-addr -falign-functions=4 -fprefetch-loop-arrays"
CXXFLAGS="${CFLAGS}"

note : -mmmx, -msse are implied by -march=pentium3

Athlon (AMD)

CFLAGS="-march=athlon -O3 -pipe -fomit-frame-pointer
-ffast-math  -funroll-loops -fforce-addr -falign-functions=4"
CXXFLAGS="${CFLAGS}"

note : -m3dnow and -mmmx optimisations are implied by -march=athlon

Athlon-tbird, aka K7 (AMD)

CFLAGS="-march=athlon-tbird -O3 -pipe -fforce-addr -fomit-frame-pointer
  -funroll-loops -falign-functions=4 -maccumulate-outgoing-args"
CXXFLAGS="${CFLAGS}"

note : -m3dnow and -mmmx optimisations are implied by -march=athlon-tbird

Notes for PPC users

    * For all PPC cflags add -fsigned-char
    * There's no such thing as -march= on PPC
    * For all 60X processors (603, 603e, 604, 604e, 604r..), do not use -mcpu (broken)
    * For G3 use -mcpu=750 (not -march= )
    * For G4 use -mcpu=7400 (or 7450)
    * -O3 is unstable on G4, use -O2

For G4, adds -maltivec. It will only be faster if the kernel is compiled with proper support for altivec, but at least, it wont break if your kernel doesn't have it.

Do use -mabi=altivec if you use -maltivec.
 楼主| 发表于 2002-12-21 18:04:11 | 显示全部楼层

不优化可以吗?我第一次装还是保守一点;)

优化了会对系统有不良影响么?
发表于 2002-12-21 18:10:26 | 显示全部楼层
不优化也是可以的,不过用那个安全优化是一点问题也不会出的。我在BLFS里用的都是疯狂优化,没问题的。在LFS里,有些包不能优化,BLFS里就没问题了。你在编译Xfree的时候,用安全的那个就好了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表