2020年12月5日星期六

compile QUME

$ apt-get install build-essential zlib1g-dev pkg-config libglib2.0-dev binutils-dev libboost-all-dev autoconf libtool libssl-dev libpixman-1-dev libpython-dev python-pip python-capstone virtualenv


qemu$ mkdir build

qemu$ cd build

out-of-tree build


u@kde:~/prjs/qemu/build$ ../configure --target-list=i386-softmmu --enable-tcg-interpreter --enable-debug-tcg --enable-debug-info

u@kde:~/prjs/qemu/build$ make

test run bios

u@kde:~/prjs/qemu/build$ ./qemu-system-i386



use vnc to see the screen

 u@kde:~/prjs/qemu/build$ sudo apt-get install xtightvncviewer



Always crash when install win7 x64 sp1, with 0xc000001e

I tried branch stable-5.0, and it seems to have a bug.

Also tried branch stable-4.2, cannot make it install win7


Currently I use the master branch, at

commit d73c46e4a84e47ffc61b8bf7c378b1383e7316b5 (HEAD -> master, tag: v5.2.0-rc4, origin/master, origin/HEAD, list)

Author: Peter Maydell <peter.maydell@linaro.org>

Date:   Tue Dec 1 16:21:01 2020 +0000


tried 

[uty@u build]$ ../configure --target-list=x86_64-softmmu --enable-system

This works, it can install win7 x64.


Don't use --enable-sdl, it make the GUI worse.


Later I will try 

[uty@u build]$ ../configure --target-list=x86_64-softmmu --enable-system --enable-tcg-interpreter --enable-debug-tcg --enable-debug-info


Two sprits that I use to install vm and start vm.

[uty@u win7_testqemu]$ cat installwin7.sh 

#!/bin/bash

~/prjs/qemu/build/qemu-img create -f qcow2 win7.hd 60G

#qemu-system-x86_64 -m 2048 -enable-kvm -cdrom ~/iso/rutgers_windows7_sp1_x64.iso -boot d  win7.hd


~/prjs/qemu/build/qemu-system-x86_64 -m 2048 \

-monitor stdio \

-vga cirrus \

-cdrom ~/iso/en_windows_7_ultimate_with_sp1_x64_dvd_618240.iso \

-boot d \

win7.hd

~/prjs/qemu/build/qemu-img create -f qcow2 -b win7.hd snapshot.hd


[uty@u win7_testqemu]$ cat installwin7.sh 

#!/bin/bash

~/prjs/qemu/build/qemu-img create -f qcow2 win7.hd 60G

#qemu-system-x86_64 -m 2048 -enable-kvm -cdrom ~/iso/rutgers_windows7_sp1_x64.iso -boot d  win7.hd


~/prjs/qemu/build/qemu-system-x86_64 -m 2048 \

-monitor stdio \

-vga cirrus \

-cdrom ~/iso/en_windows_7_ultimate_with_sp1_x64_dvd_618240.iso \

-boot d \

win7.hd

~/prjs/qemu/build/qemu-img create -f qcow2 -b win7.hd snapshot.hd



Notice, qemu-img and qemu-system-x86_64 should use the ones with the same version


2020年7月20日星期一

Nios II minimum system

AN 717: Nios II Gen2 Hardware Development Tutorial

The latest is from 2014.09.22. Things change.

The minimum system only needs clk, nios process, on chip memory, and jtag art.

I use Quartus 19.1.

The difference is that the new Nios II processor module has two more ports, debug_reset_request and debug_mem_slave.


The debug_reset_request should connect to all other modules except clk_0.
This reset output signal appears when the JTAG Debug module is enabled. This signal is triggered by the JTAG debugger or nios2-download -r command. This signal must be connected to the reset input signal of the Nios II processor which allows the JTAG debugger to reset the processor. This signal can be connected to the reset input signal of other components when needed.

debug_mem_slave connects both data_master and instruction master.


2020年7月19日星期日

Archlinux, usb blaster setup

Quartus programmer fails immediately when downloading.

Add the following lines to the /etc/udev/rules.d/51-usbblaster.rules file.
# Intel FPGA Download Cable
SUBSYSTEM=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6001", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6002", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6003", MODE="0666" 

# Intel FPGA Download Cable II
SUBSYSTEM=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6010", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6810", MODE="0666"



If the programmer takes a while to fail,  check the jtagd process, it may become a zombie process.
$ sudo killall -9 jtagd   # Kill jtagd, ...
$ sudo killall -9 jtagd   # ...and verify jtagd is indeed not running.
jtagd: no process found   # Good, verified.

If everything is ok,  run jtagconfig -d, you should see this

[uty@u bin]$ pwd
/home/uty/intelFPGA_lite/19.1/quartus/bin
[uty@u bin]$ jtagconfig -d
1) USB-Blaster [1-3]
   (JTAG Server Version 19.1.0 Build 670 09/22/2019 SJ Standard Edition)
  020F10DD   10CL006(Y|Z)/10CL010(Y|Z)/.. (IR=10)
    Design hash    FB22D0B4FE4AA5509233
    + Node 19104600  Nios II #0
    + Node 0C006E00  JTAG UART #0
    + Node 00086E00  (110:1) #0

  Captured DR after reset = (020F10DD) [32]
  Captured IR after reset = (155) [10]
  Captured Bypass after reset = (0) [1]
  Captured Bypass chain = (0) [1]
  JTAG clock speed 6 MHz

2020年7月13日星期一

Nios II Eclipse

Intel Software: Quartus Prime Pro, Quartus Prime Standard
Type: Answers
Area: Tools

Last Modified: April 03, 2019
Version Found: v19.1
Bug ID: 1409124444

Is the Nios® II Software Build Tools (SBT) for Eclipse included in the full installation of the Intel® Quartus® Prime Pro Edition software starting from version 19.1?

Description

No, the Nios® II SBT for Eclipse is not included starting from Intel® Quartus® Prime Pro and Standard Edition software version 19.1 onwards.

Workaround/Fix

To install the Nios® II SBT for Eclipse, follow the steps below:
1. Download CDT 8.8.1 which is Eclipse C/C++ IDE for Mars.2
2. Extract the downloaded file into <Intel Quartus installation directory>/nios2eds/bin.  You should see the <Intel Quartus installation directory>/nios2eds/bin/eclipse folder after extraction is done.
3. Rename the <Intel Quartus installation directory>/nios2eds/bin/eclipse folder to <Intel Quartus installation directory>/nios2eds/bin/eclipse_nios2
4. Extract the <Intel Quartus installation directory>/nios2eds/bin/eclipse_nios2_plugins.zip (or tar.gz for Linux) to <Intel Quartus installation directory>/nios2eds/bin. The extraction will override files in <Intel Quartus installation directory>/nios2eds/bin/eclipse_nios2. 
5. Verify the extraction is done correctly by making sure you see the <Intel Quartus installation directory>/nios2eds/bin/eclipse_nios2/plugin_customization.ini file
6. You can now launch Nios II SBT for Eclipse via eclipse-nios2.exe

The instructions are included in the <Intel Quartus installation directory>/nios2eds/bin/README.
This information will be included in the future release version of Intel® FPGA Software Installation and Licensing User Guide.

Platform Designer "Can't locate Getopt/Long.pm" Error

Quartus 19.1

The following solves it.

export PERL5LIB=/home/uty/intelFPGA_lite/19.1/quartus/linux64/perl/lib/5.28.1

into

~/.bashrc

solved the problem. Please note that the application must be restarted to inherit the environment variable

2020年5月26日星期二

Generate customized manual initcpio

Generate customized manual initcpio

Users can generate an image using an alternative configuration file. For example, the following will generate an initramfs image according to the directions in /etc/mkinitcpio-custom.conf and save it at /boot/linux-custom.img.
# mkinitcpio -c /etc/mkinitcpio-custom.conf -g /boot/linux-custom.img
If generating an image for a kernel other than the one currently running, add the kernel version to the command line. You can see available kernel versions in /usr/lib/modules/.
# mkinitcpio -g /boot/linux-custom2.img -k 3.3.0-ARCH

stop arch linux upgrade kernel

$ sudo vim /etc/pacman.conf

IgnorePkg=linux


2020年5月8日星期五



先试最简单的,第一个pipeline加在ID和EX之间。
之前的程序是controller和datapath分开的,流水线寄存器加在这代码上最好处理。
但现在不问题是datapath里包含pcreg和regfile。pcreg应该是在IF阶段,没有IF也应该在ID
里。


pcreg并没有经过流水线寄存器,如图上红线。虽然pcreg在datapath模块里,但实际上可以把它看
做在第一段流水线里,因为它的下一阶段instr是在流水线寄存器里了。但pcreg并不能和datapath
模块里不其它内容同步,+4是没问题的,但其它pcnextbr,pcnext都要首先等instr的内容,然后再读寄存器,接着还要再EX阶段里用ALU做下运算后才能确定。

比如测试例子里第一句指令就是一个beq或者jump,可以看到pcnext是得不出值的,所以还是
pcplus4,所以这时候就要用到stalll,等待后面EX段的结果。

0: 00000663 beq x0 x0 12 <test>
4: 00a00093 addi x1 x0 10
8: 00108093 addi x1 x1 1

0000000c <test>:
c: 00000533 add x10 x0 x0


That's the first cycle after reset. The first instruction is beq x0, x0, 0xc. It's a determined branch. You can see that the instr is still empty because it's in the second stage pipeline. pcnext is +4. 

In the second clock cycle.


The pipeline register already read in the second instruction (00a00093)addi x1, x0, 10 which should never be executed. This instruction will be executed.

突然理解里MIPS里为什么在跳转语句后面有个slot,这个位置上的语句不受前面跳转语句不影响,无论怎样都会执行,应该就是这种情况吧。这样不需要刷流水线,虽然看上去搞个slot和别扭。

Now, dp.instr is 00000663, it's the bne. This is the first instruction that just be executed, at the second clock. So the pcnext updated to 0x10, which is incorrect. It should be 0xc.
跳转的位置不对,多了4.应该是和第二条指令读进流水线寄存器有关,pc又加了4.
这就体现出MIPS的鸡贼了。比如beq x0,x0,imm 这种。在RISC-V里, pcnextbr=pc+imm。
在MIPS里,pcnextbr=pc+4+imm。

第三个时钟周期,也就是执行不第二条指令就是这条slot上的4: 00a00093 addi x1 x0 10
可以从上图看到,x1被写入10了。(真正的写入在下一时钟的上升沿。没做下降沿写寄存器,因为
这样regfile里flipflop就要翻倍了,还不懂,好像网上的实现是这样。)

再确认一条指令,x1里值已经是10了,这条指令把x1+1, 11已经进来了

----------------------------------------------------------------------------------------------------------

pcreg放这个位置很不便于理解,后面要把它移出datapath。

现在controller,decoder放在第一段流水线里了,但regfile放到第二段流水线。后面也要把
regfile放到ID段来,因为在ID段里访问寄存器据说是开销很大的部分。





2020年4月21日星期二

install ModelSim on Arch linux

My Arch linux is 64-bit, ModelSim only have 32-bit version.

First of all, do what the following blog says.
https://gist.github.com/dries007/36c31fb8b2d712dfb41c6709f16e6e66

ModelSim 17.1 (Starters Edition) for (Arch) Linux

You need to download the setup file yourself. Put in where you run the setup script. Easy DL link It should be named ModelSimSetup-17.1.0.590-linux.run.
  1. Install dependencies (some AUR, both 32 and 64 bit is required.)
    • 64 bit: expat fontconfig freetype2 xorg-fonts-type1 glibc gtk2 libcanberra libpng libpng12 libice libsm util-linux ncurses tcl tcllib zlib libx11 libxau libxdmcp libxext libxft libxrender libxt libxtst
    • 32 bit lib32-expat lib32-fontconfig lib32-freetype2 lib32-glibc lib32-gtk2 lib32-libcanberra lib32-libpng lib32-libpng12 lib32-libice lib32-libsm lib32-util-linux lib32-ncurses lib32-zlib lib32-libx11 lib32-libxau lib32-libxdmcp lib32-libxext lib32-libxft lib32-libxrender lib32-libxt lib32-libxtst
    • ncurses compat libs: ncurses5-compat-libs and lib32-ncurses5-compat-libs
  2. Run setup file, from console, install in default location (~/intelFPGA/17.1) The setup hangs after completing.
  3. Get lib32-freetype2-2.5.0.1 and unpack libs to ~/intelFPGA/17.1/modelsim_ase/lib32
  4. Modify the startup script (~/intelFPGA/17.1/modelsim_ase/vco)
    • Replace linux_rh60 with linux
    • Add LD_LIBRARY_PATH=${dir}/lib32 after $dir is set
A semi automatic script is provided below for the lazy :)


-----the script------
#/bin/bash

echo Installing dependencies...
pacaur -S --needed expat fontconfig freetype2 xorg-fonts-type1 glibc gtk2 libcanberra libpng libpng12 libice libsm util-linux ncurses tcl tcllib zlib libx11 libxau libxdmcp libxext libxft libxrender libxt libxtst lib32-expat lib32-fontconfig lib32-freetype2 lib32-glibc lib32-gtk2 lib32-libcanberra lib32-libpng lib32-libpng12 lib32-libice lib32-libsm lib32-util-linux lib32-ncurses lib32-zlib lib32-libx11 lib32-libxau lib32-libxdmcp lib32-libxext lib32-libxft lib32-libxrender lib32-libxt lib32-libxtst ncurses5-compat-libs lib32-ncurses5-compat-libs

echo Running setup file...
./ModelSimSetup-17.1.0.590-linux.run --modelsim_edition modelsim_ase --accept_eula 1 --mode unattended --unattendedmodeui minimal &
PID=$!
echo Press enter when the setup dialog says \"Setup complete.\"
read -n 1
kill $PID

wget -q --show-progress https://dl.dries007.net/lib32-freetype2-2.5.0.1.tar.xz -O lib32-freetype2-2.5.0.1.tar.xz
tar xf lib32-freetype2-2.5.0.1.tar.xz -C ~/intelFPGA/17.1/modelsim_ase/

cd ~/intelFPGA/17.1/modelsim_ase/
sed -i 's/linux_rh60/linux/' vco
sed -i 's/dir=`dirname "$arg0"`/dir=`dirname "$arg0"`\nexport LD_LIBRARY_PATH=${dir}\/lib32/' vco # adds "export LD_LIBRARY_PATH=${dir}/lib32" after $dir is found.
cat > ~/.local/share/applications/modelsim.desktop <<EOF
[Desktop Entry]
Version=1.0
Name=ModelSim
Comment=ModelSim
Exec=$HOME/intelFPGA/17.1/modelsim_ase/bin/vsim
Icon=applications-electronics
Terminal=true
Type=Application
Categories=Development
EOF

echo "Done, enjoy!"

------------------------------------------------------------------------------------------

To install 32bit lib:

sudo vim /etc/pacman.conf

uncomment multilib:

# If you want to run 32 bit applications on your x86_64 system,
# enable the multilib repositories as required here.

multilib-testing]
Include = /etc/pacman.d/mirrorlist

[multilib]
Include = /etc/pacman.d/mirrorlist


then 
$sudo pacman -Sy
$sudo pacman -Syy


You may have conflict files when installing lib32-gtk2. Skipping it is fine.


-------------------------------------------------------------------------------------

When trying to run vsim, this may show up.

[uty@u bin]$ ./vsim 
./../linux/vish: symbol lookup error: /usr/lib32/libfontconfig.so.1: undefined symbol: FT_Done_MM_Var


it means that the version of libfontconfig is too new, it doesn't have FT_Done_MM_Var anymore.
What I installed is :

[uty@u bin]$ pacman -Q lib32-fontconfig
lib32-fontconfig 2:2.13.91+24+g75eadca-2

I didn't find the released binary. 

So do this.

https://j-marjanovic.io/new-ubuntu-old-problems-with-modelsim.html

$ git clone https://gitlab.freedesktop.org/fontconfig/fontconfig.git
$ git checkout -b 2.12.92 2.12.92
$ sudo pacman -S lib32-libxml2

$ aclocal -I m4
$ autoconf
$ libtoolize
$ ./autogen.sh
$ CFLAGS=-m32 LDFLAGS=-L/home/jan/local/packages/freetype-2.4.7-32bit/lib ./configure --prefix=/home/jan/local/packages/fontconfig-2.12.92-32bit --enable-libxml2
$ make
$ make install

Basically, compile it from source code, taking branch 2.12.92.

copy the generated binary to /usr/lib32
[uty@u fontconfig]$ sudo cp src/.libs/libfontconfig.so.1.11.0 /usr/lib32/

[uty@u fontconfig]$ ls /usr/lib32/libfont* -l
lrwxrwxrwx 1 root root     34 Apr 21 15:59 /usr/lib32/libfontconfig.so -> /usr/lib32/libfontconfig.so.1.11.0
lrwxrwxrwx 1 root root     34 Apr 21 15:58 /usr/lib32/libfontconfig.so.1 -> /usr/lib32/libfontconfig.so.1.11.0
-rwxr-xr-x 1 root root 342952 Apr 21 15:55 /usr/lib32/libfontconfig.so.1.11.0
-rwxr-xr-x 1 root root 342952 Apr 21 15:53 /usr/lib32/libfontconfig.so.1.12.0

then create the symbolic link
[uty@u fontconfig]$ sudo ln -sfn /usr/lib32/libfontconfig.so.1.11.0 /usr/lib32/libfontconfig.so


Finally, I can run it.

2020年4月17日星期五

increase dmesg buffer

set log_buf_len in kernel parameters

u@raspberrypi:~ $ cat /boot/cmdline.txt
console=ttyS0,115200 log_buf_len=8M root=PARTUUID=738a4d67-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

hex to bin

$xxd -r -p input.txt output.bin
u@raspberrypi:~ $ cat tmp.txt | head -n 16
00 F0 3E B8 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
41 EA 00 03 13 43 9B 07 30 B5 10 D1 0C 68 03 68 
63 40 13 60 4C 68 43 68 63 40 53 60 8C 68 83 68 
63 40 93 60 C9 68 C3 68 4B 40 D3 60 30 BD 00 23 
CD 5C C4 5C 6C 40 D4 54 01 33 10 2B F8 D1 30 BD 
2D E9 F0 4F 8F B0 01 24 0E AD 07 46 0E 46 91 46 
11 46 0D F1 19 00 0D 22 05 F8 20 4D 05 93 DD F8 
68 B0 DD F8 6C 80 9B F0 C9 FE 8D F8 27 40 00 23 
19 9C 38 46 8D F8 26 30 31 46 08 3C 2A 46 23 46 
CD F8 00 B0 CD F8 04 80 00 F0 BE FA 38 BB 0B EB 
04 03 08 EB 04 0A 8D F8 26 00 31 46 8D F8 27 00 
2A 46 8D E8 08 04 38 46 08 23 00 F0 AD FA B0 B9 
18 9B 38 46 8D E8 18 01 0A AC 31 46 4A 46 05 9B 
03 94 00 F0 5F F8 50 B9 20 46 51 46 08 22 9B F0 
8D FE 00 28 14 BF 4F F0 FF 30 00 20 01 E0 4F F0 
u@raspberrypi:~ $ xxd -r -p tmp.txt bcm43455.rom
u@raspberrypi:~ $ hexdump -C bcm43455.rom | head -n 16
00000000  00 f0 3e b8 00 00 00 00  00 00 00 00 00 00 00 00  |..>.............|
00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000020  41 ea 00 03 13 43 9b 07  30 b5 10 d1 0c 68 03 68  |A....C..0....h.h|
00000030  63 40 13 60 4c 68 43 68  63 40 53 60 8c 68 83 68  |c@.`LhChc@S`.h.h|
00000040  63 40 93 60 c9 68 c3 68  4b 40 d3 60 30 bd 00 23  |c@.`.h.hK@.`0..#|
00000050  cd 5c c4 5c 6c 40 d4 54  01 33 10 2b f8 d1 30 bd  |.\.\l@.T.3.+..0.|
00000060  2d e9 f0 4f 8f b0 01 24  0e ad 07 46 0e 46 91 46  |-..O...$...F.F.F|
00000070  11 46 0d f1 19 00 0d 22  05 f8 20 4d 05 93 dd f8  |.F.....".. M....|
00000080  68 b0 dd f8 6c 80 9b f0  c9 fe 8d f8 27 40 00 23  |h...l.......'@.#|
00000090  19 9c 38 46 8d f8 26 30  31 46 08 3c 2a 46 23 46  |..8F..&01F.<*F#F|
000000a0  cd f8 00 b0 cd f8 04 80  00 f0 be fa 38 bb 0b eb  |............8...|
000000b0  04 03 08 eb 04 0a 8d f8  26 00 31 46 8d f8 27 00  |........&.1F..'.|
000000c0  2a 46 8d e8 08 04 38 46  08 23 00 f0 ad fa b0 b9  |*F....8F.#......|
000000d0  18 9b 38 46 8d e8 18 01  0a ac 31 46 4a 46 05 9b  |..8F......1FJF..|
000000e0  03 94 00 f0 5f f8 50 b9  20 46 51 46 08 22 9b f0  |...._.P. FQF."..|
000000f0  8d fe 00 28 14 bf 4f f0  ff 30 00 20 01 e0 4f f0  |...(..O..0. ..O.|

2020年4月11日星期六

highlight function names in c code

" Highlight all function names
syntax match cCustomFunc /\w\+\s*(/me=e-1,he=e-1
highlight def link cCustomFunc Function
To use this, put it in ~/.vim/after/syntax/c/highlight_functions.vim. (All files in ~/.vim/after/syntax/[filetype]/ will be sourced when vim opens a file of type [filetype].)

2020年4月10日星期五

install raspbian without monitor

Different from ubuntu, there is no default serial console.

Need to connect raspberry to the network through the ethernet cable.

https://hackernoon.com/raspberry-pi-headless-install-462ccabd75d0

SSH is also not enabled by default.  Need to put a file "ssh" into the boot partition of the SD card.

After reboot

Search subnet.
$ nmap -p 22 192.168.3.1/24

user: pi
pass: raspberry

Next is to enable wifi.

Something called rfkill is in the way.

u@raspberrypi:~ $ sudo rfkill list all
0: phy0: Wireless LAN
Soft blocked: yes
Hard blocked: no
1: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
u@raspberrypi:~ $ sudo rfkill unblock wifi
u@raspberrypi:~ $ sudo rfkill list all
0: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
1: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
u@raspberrypi:~ $ sudo ifconfig wlan0 up


The rest is the same.

Remember to enable SSH,  that ssh file only good for one time.

2020年4月8日星期三

ubuntu server 18.04 setup wifi

u@ubuntu:~$ ifconfig wlan0 up

u@ubuntu:~$ wpa_passphrase wifiname password | sudo tee /etc/wpa_supplicant.conf

u@ubuntu:~$ sudo wpa_supplicant -B -c /etc/wpa_supplicant.conf -i wlan0

// get ip
u@ubuntu:~$ sudo dhclient wlan0



//test
u@ubuntu:~$ ping 8.8.8.8



make it auto connect wifi.

raspberry pi 4 won't bring up wlan0 on boot.

$ sudo apt-get ifupdown

$ sudo vim /etc/rc.local


edit /etc/rc.local

u@ubuntu:~$ cat /etc/rc.local
ifup wlan0


edit /etc/network/interfacs

u@ubuntu:~$ cat /etc/network/interfaces
# ifupdown has been replaced by netplan(5) on this system.  See
# /etc/netplan for current configuration.
# To re-enable ifupdown on this system, you can run:
#    sudo apt install ifupdown

auto wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant.conf


2020年3月10日星期二

set textwidth and reformat current file

:set textwidth=75

Select the lines of text you want to re-format:
v
Reformat it:
gq

e.g.

select all

g
v
G

reformat

gq

2020年3月5日星期四

2020年3月2日星期一

setup git send-email



perl -MCPAN -e shell

install IO::Socket::SSL


pacman -S perl-Authen-SASL


if using gmail set google
Less secure app access

2020年2月25日星期二

arch linux, downgrade one package

Linux u 5.5.5-arch1-1

$ pacman --query binutils
binutils 2.34.1-1

compiling perf, got the following errors.



  CC       util/pmu.o
  CC       util/pmu-flex.o
  CC       util/srcline.o
  CC       util/cloexec.o
util/srcline.c: In function ‘find_address_in_section’:
util/srcline.c:200:7: error: implicit declaration of function ‘bfd_get_section_flags’; did you mean ‘bfd_set_section_flags’? [-Werror=implicit-function-declaration]
  200 |  if ((bfd_get_section_flags(abfd, section) & SEC_ALLOC) == 0)
      |       ^~~~~~~~~~~~~~~~~~~~~
      |       bfd_set_section_flags
util/srcline.c:200:7: error: nested extern declaration of ‘bfd_get_section_flags’ [-Werror=nested-externs]
util/srcline.c:204:8: error: implicit declaration of function ‘bfd_get_section_vma’; did you mean ‘bfd_set_section_vma’? [-Werror=implicit-function-declaration]
  204 |  vma = bfd_get_section_vma(abfd, section);
      |        ^~~~~~~~~~~~~~~~~~~
      |        bfd_set_section_vma
util/srcline.c:204:8: error: nested extern declaration of ‘bfd_get_section_vma’ [-Werror=nested-externs]
util/srcline.c:205:9: error: implicit declaration of function ‘bfd_get_section_size’; did you mean ‘bfd_set_section_size’? [-Werror=implicit-function-declaration]
  205 |  size = bfd_get_section_size(section);
      |         ^~~~~~~~~~~~~~~~~~~~
      |         bfd_set_section_size
util/srcline.c:205:9: error: nested extern declaration of ‘bfd_get_section_size’ [-Werror=nested-externs]
  CC       util/call-path.o
  CC       util/rwsem.o
  CC       util/thread-stack.o


It needs downgrade binutils-2.34 to 2.33

here is how


find the the package's url, from here



then execute this:

$ sudo pacman -U https://archive.archlinux.org/packages/b/binutils/binutils-2.33.1-1-x86_64.pkg.tar.xz