1 min read

Git 및 기타 등등 팁 저장 포스트

생각날 때마다 추가합니다. 개별 포스트로 남기기 애매한 친구들 매번 검색하다가 질려서 저장용으로 적는 글.

  • Git submodule까지 모두 풀 하기
    • git submodule update --recursive
  • gcc 버전 여러 개 쓰기 (update alternative)
    • sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 600

VScode 현재 Workspace Duplicate

ctrl + shift + P 의 커맨드팔레트에서 duplicate 검색하면 나옴

옛날 리눅스 커널 컴파일하기

error : gcc: error: elf_x86_64: No such file or directory

  • Sol : arch/x86/vdso/Makefile에서 -m elf_x86_64 -> -m64, -m elf_i386 -> -m32

Error : No PIC enabled

  • Sol : 옛날 gcc 사용. (최신 gcc 지원 안 됨)

Error : Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at kernel/timeconst.pl line 373.

  • Sol : Perl 버전 문제. defined() 없애면 됨

리눅스 커널 VScode 셋업

GitHub - FlorentRevest/linux-kernel-vscode: Reference setup for Linux kernel development in VSCode
Reference setup for Linux kernel development in VSCode - FlorentRevest/linux-kernel-vscode

이거 하고 빌드해서 compile-commands.json 만들고 clangd indexing 해주면 끝.

{
    "clangd.arguments": [
        "--compile-commands-dir=${workspaceFolder}",
        "--background-index",
        "--completion-style=detailed",
        "--header-insertion=never",
        "-log=info",
        "-pretty"
    ],
    "clangd.path": "/usr/bin/clangd"
}

아마도 필요없지만 혹시나 인식이 안될때

.config는 알아서~ make menuconfig로 해도 되고~