Windows Bash-Emacs生成失败:已启用内存保护
我试图在Windows Bash(WinBash?Win Bash?)中编译emacs-24.4,但是遇到了一个问题,Windows似乎启用了内存保护,这破坏了emacs构建 “make”(配置正常)之后出现的错误是: 在etc/问题文件中,相关章节给出:Windows Bash-Emacs生成失败:已启用内存保护,windows,bash,emacs,win-bash,Windows,Bash,Emacs,Win Bash,我试图在Windows Bash(WinBash?Win Bash?)中编译emacs-24.4,但是遇到了一个问题,Windows似乎启用了内存保护,这破坏了emacs构建 “make”(配置正常)之后出现的错误是: 在etc/问题文件中,相关章节给出: *** Segfault during `make bootstrap' under the Linux kernel. In Red Hat Linux kernels, "Exec-shield" functionality is en
*** Segfault during `make bootstrap' under the Linux kernel.
In Red Hat Linux kernels, "Exec-shield" functionality is enabled by
default, which creates a different memory layout that can break the
emacs dumper. Emacs tries to handle this at build time, but if this
fails, the following instructions may be useful.
Exec-shield is enabled on your system if
cat /proc/sys/kernel/exec-shield
prints a value other than 0. (Please read your system documentation
for more details on Exec-shield and associated commands.)
Additionally, Linux kernel versions since 2.6.12 randomize the virtual
address space of a process by default. If this feature is enabled on
your system, then
cat /proc/sys/kernel/randomize_va_space
prints a value other than 0.
When these features are enabled, building Emacs may segfault during
the execution of this command:
./temacs --batch --load loadup [dump|bootstrap]
To work around this problem, you can temporarily disable these
features while building Emacs. You can do so using the following
commands (as root). Remember to re-enable them when you are done,
by echoing the original values back to the files.
echo 0 > /proc/sys/kernel/exec-shield
echo 0 > /proc/sys/kernel/randomize_va_space
Or, on x86, you can try using the `setarch' command when running
temacs, like this:
setarch i386 -R ./temacs --batch --load loadup [dump|bootstrap]
or
setarch i386 -R make
(The -R option disables address space randomization.)
而且,毫不奇怪,如果我想看看它是否被启用。。它是:
$ cat /proc/sys/kernel/randomize_va_space
2
但不幸的是,我尝试禁用它(即使以管理员身份运行bash),它失败了:
$ sudo echo 0 > /proc/sys/kernel/randomize_va_space
bash: /proc/sys/kernel/randomize_va_space: Permission denied
此外,setarch不能使用:
setarch x86_84 -R make
建议?查看以下位置的说明: 重要部分: 要禁用它,请运行
echo 0 | sudo tee /proc/sys/kernel/randomize_va_space
要再次启用它,请运行
echo 2 | sudo tee /proc/sys/kernel/randomize_va_space
这是开着的还是WSL?
echo 2 | sudo tee /proc/sys/kernel/randomize_va_space