GithubHelp home page GithubHelp logo

loongson / glibc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bminor/glibc

7.0 7.0 12.0 234.15 MB

Unofficial mirror of sourceware glibc repository. Updated daily.

Home Page: https://sourceware.org/git/gitweb.cgi?p=glibc.git

License: GNU General Public License v2.0

Makefile 0.88% C 72.43% C++ 0.33% Python 0.78% Shell 0.45% Awk 0.09% Perl 0.04% Assembly 20.25% TeX 0.52% Yacc 0.01% M4 0.16% Roff 3.28% sed 0.01% Pawn 0.01% SourcePawn 0.73% POV-Ray SDL 0.03%

glibc's People

Contributors

ajaeger avatar allanmcrae avatar andreas-schwab avatar aurel32 avatar cmetcalf-tilera avatar codonell avatar davem330 avatar drepper avatar eggert avatar employedrussian avatar frobtech avatar fweimer-rh avatar hjl-tools avatar inconstante avatar jakubjelinek avatar jsm28 avatar mike-fabian avatar neleai avatar nsz-arm avatar rluzynski avatar rth7680 avatar siddhesh avatar snogglethorpe avatar sthibaul avatar stliibm avatar tschwinge avatar tuliom avatar vapier avatar zackw avatar zatrazz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

glibc's Issues

glibc-2.33.9000 Failed to adapt loongarch

while I run glibc-glibc-2.33.9000/configure --host=loongarch-linux-gnu, error happened as checking host system type... Invalid configuration 'loongarch-linux-gnu': machine 'loongarch-unknown' not recognized.

By reading the source code, I run as glibc-glibc-2.33.9000/scripts/config.sub loongarch-linux-gnu again, which is the line that directly caused the error. Throw adding set -x at glibc-glibc-2.33.9000/scripts/config.sub,I get the following msg:

root@9848f4ac5022:/build# /build/glibc-glibc-2.33.9000/scripts/config.sub loongarch-linux-gnu
+ timestamp=2019-01-01
+ echo /build/glibc-glibc-2.33.9000/scripts/config.sub
+ sed -e s,.*/,,
+ me=config.sub
+ usage=Usage: /build/glibc-glibc-2.33.9000/scripts/config.sub [OPTION] CPU-MFR-OPSYS or ALIAS

Canonicalize a configuration name.

Options:
  -h, --help         print this help, then exit
  -t, --time-stamp   print date of last modification, then exit
  -v, --version      print version number, then exit

Report bugs and patches to <[email protected]>.
+ version=GNU config.sub (2019-01-01)

Copyright 1992-2019 Free Software Foundation, Inc.

This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ help=
Try `config.sub --help' for more information.
+ test 1 -gt 0
+ break
+ IFS=- read field1 field2 field3 field4
+ maybe_os=linux-gnu
+ basic_machine=loongarch
+ os=linux-gnu
+ cpu=loongarch
+ vendor=unknown
+ unset -v basic_machine
+ echo Invalid configuration `loongarch-linux-gnu': machine `loongarch-unknown' not recognized
Invalid configuration `loongarch-linux-gnu': machine `loongarch-unknown' not recognized
+ exit 1

Those msgs lead me to line [1157~1252] of glibc-glibc-2.33.9000/scripts/config.sub.There has a so long supported cpu list, without any one seem like loongson

undefined reference to main

新世界使用 rust 编译 librsvg,在编译其中一个库 proc-macro2 时,在链接阶段报错: undefined reference to main

详细信息如下:

error: linking with `cc` failed: exit status: 1
  |                                            
  = note: "cc" "/archlinux/build/librsvg/src/librsvg/target/release/build/proc-macro2-4b2f7c5e27dcd1e6/build_script_build-4b2f7c5e27dcd1e6.build_script_build.e30a32e1-cgu.0.rcgu.o" "/archlinux/build/librsvg/src/librsvg/target/release/build
/proc-macro2-4b2f7c5e27dcd1e6/build_script_build-4b2f7c5e27dcd1e6.build_script_build.e30a32e1-cgu.1.rcgu.o" "/archlinux/build/librsvg/src/librsvg/target/release/build/proc-macro2-4b2f7c5e27dcd1e6/build_script_build-4b2f7c5e27dcd1e6.build_s
cript_build.e30a32e1-cgu.10.rcgu.o" "/archlinux/build/librsvg/src/librsvg/target/release/build/proc-macro2-4b2f7c5e27dcd1e6/build_script_build-4b2f7c5e27dcd1e6.build_script_build.e30a32e1-cgu.11.rcgu.o" "/archlinux/build/librsvg/src/librsv
g/target/release/build/proc-macro2-4b2f7c5e27dcd1e6/build_script_build-4b2f7c5e27dcd1e6.build_script_build.e30a32e1-cgu.12.rcgu.o" "/archlinux/build/librsvg/src/librsvg/target/release/build/proc-macro2-4b2f7c5e27dcd1e6/build_script_build-4
b2f7c5e27dcd1e6.build_script_build.e30a32e1-cgu.13.rcgu.o" "/archlinux/build/librsvg/src/librsvg/target/release/build/proc-macro2-4b2f7c5e27dcd1e6/build_script_build-4b2f7c5e27dcd1e6.build_script_build.e30a32e1-cgu.14.rcgu.o" "/archlinux/b
uild/librsvg/src/librsvg/target/release/build/proc-macro2-4b2f7c5e27dcd1e6/build_script_build-4b2f7c5e27dcd1e6.build_script_build.e30a32e1-cgu.15.rcgu.o" "/archlinux/build/librsvg/src/librsvg/target/release/build/proc-macro2-4b2f7c5e27dcd1
e6/build_script_build-4b2f7c5e27dcd1e6.build_script_build.e30a32e1-cgu.2.rcgu.o" "/archlinux/build/librsvg/src/librsvg/target/release/build/proc-macro2-4b2f7c5e27dcd1e6/build_script_build-4b2f7c5e27dcd1e6.build_script_build.e30a32e1-cgu.3.
rcgu.o" "/archlinux/build/librsvg/src/librsvg/target/release/build/proc-macro2-4b2f7c5e27dcd1e6/build_script_build-4b2f7c5e27dcd1e6.build_script_build.e30a32e1-cgu.4.rcgu.o" "/archlinux/build/librsvg/src/librsvg/target/release/build/proc-m
acro2-4b2f7c5e27dcd1e6/build_script_build-4b2f7c5e27dcd1e6.build_script_build.e30a32e1-cgu.5.rcgu.o" "/archlinux/build/librsvg/src/librsvg/target/release/build/proc-macro2-4b2f7c5e27dcd1e6/build_script_build-4b2f7c5e27dcd1e6.build_script_b
uild.e30a32e1-cgu.6.rcgu.o" "/archlinux/build/librsvg/src/librsvg/target/release/build/proc-macro2-4b2f7c5e27dcd1e6/build_script_build-4b2f7c5e27dcd1e6.build_script_build.e30a32e1-cgu.7.rcgu.o" "/archlinux/build/librsvg/src/librsvg/target/
release/build/proc-macro2-4b2f7c5e27dcd1e6/build_script_build-4b2f7c5e27dcd1e6.build_script_build.e30a32e1-cgu.8.rcgu.o" "/archlinux/build/librsvg/src/librsvg/target/release/build/proc-macro2-4b2f7c5e27dcd1e6/build_script_build-4b2f7c5e27d
cd1e6.build_script_build.e30a32e1-cgu.9.rcgu.o" "/archlinux/build/librsvg/src/librsvg/target/release/build/proc-macro2-4b2f7c5e27dcd1e6/build_script_build-4b2f7c5e27dcd1e6.23ewl4ikofxq5i5v.rcgu.o" "-Wl,--as-needed" "-L" "/archlinux/build/l
ibrsvg/src/librsvg/target/release/deps" "-L" "/usr/lib64/rustlib/loongarch64-unknown-linux-gnu/lib" "-Wl,--start-group" "-Wl,-Bstatic" "/usr/lib/rustlib/loongarch64-unknown-linux-gnu/lib/libstd-e45cf875b9375bb0.rlib" "/usr/lib/rustlib/loon
garch64-unknown-linux-gnu/lib/libpanic_unwind-01ed1759f346a29f.rlib" "/usr/lib/rustlib/loongarch64-unknown-linux-gnu/lib/libminiz_oxide-95731f3f5bdd5286.rlib" "/usr/lib/rustlib/loongarch64-unknown-linux-gnu/lib/libadler-fb646b0162bea90e.rl
ib" "/usr/lib/rustlib/loongarch64-unknown-linux-gnu/lib/libobject-efb6496e33c03c13.rlib" "/usr/lib/rustlib/loongarch64-unknown-linux-gnu/lib/libmemchr-6be70ae260cf41b4.rlib" "/usr/lib/rustlib/loongarch64-unknown-linux-gnu/lib/libaddr2line-
de981609553d1179.rlib" "/usr/lib/rustlib/loongarch64-unknown-linux-gnu/lib/libgimli-5ec606accfe21773.rlib" "/usr/lib/rustlib/loongarch64-unknown-linux-gnu/lib/libstd_detect-7a92f7b8f5083e0e.rlib" "/usr/lib/rustlib/loongarch64-unknown-linux
-gnu/lib/librustc_demangle-8b489dc20266b0e9.rlib" "/usr/lib/rustlib/loongarch64-unknown-linux-gnu/lib/libhashbrown-12918ac802989fe3.rlib" "/usr/lib/rustlib/loongarch64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-f7d9b047dd68e7d7.rli
b" "/usr/lib/rustlib/loongarch64-unknown-linux-gnu/lib/libunwind-937da1471c4aaa24.rlib" "/usr/lib/rustlib/loongarch64-unknown-linux-gnu/lib/libcfg_if-5e13808e7d636159.rlib" "/usr/lib/rustlib/loongarch64-unknown-linux-gnu/lib/liblibc-7b79b1
f641133a96.rlib" "/usr/lib/rustlib/loongarch64-unknown-linux-gnu/lib/liballoc-304a2d21d195bc36.rlib" "/usr/lib/rustlib/loongarch64-unknown-linux-gnu/lib/librustc_std_workspace_core-f6725d145d7e6d85.rlib" "/usr/lib/rustlib/loongarch64-unkno
wn-linux-gnu/lib/libcore-b7107a83be44bb5a.rlib" "-Wl,--end-group" "/usr/lib/rustlib/loongarch64-unknown-linux-gnu/lib/libcompiler_builtins-f71783c5179395b9.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-lu
til" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "/usr/lib64/rustlib/loongarch64-unknown-linux-gnu/lib" "-o" "/archlinux/build/librsvg/src/librsvg/target/release/build/proc-macro2-4b2f7c5e27dcd1e6/build_script_build-4b2f7c5e27dcd1e6" "-W
l,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-nodefaultlibs"                                                                                                                                                                             
  = note: /usr/bin/ld: /usr/lib/gcc/loongarch64-unknown-linux-gnu/12.0.1/../../../../lib64/Scrt1.o: in function `L0':  
          /archlinux/build/glibc/src/glibc-2.35/csu/../sysdeps/loongarch/start.S:49: undefined reference to `main'     
          /usr/bin/ld: /archlinux/build/glibc/src/glibc-2.35/csu/../sysdeps/loongarch/start.S:49: undefined reference to `main'                                                                                                                
          /usr/bin/ld: /archlinux/build/glibc/src/glibc-2.35/csu/../sysdeps/loongarch/start.S:49: undefined reference to `main'                                                                                                                
          /usr/bin/ld: /archlinux/build/glibc/src/glibc-2.35/csu/../sysdeps/loongarch/start.S:49: undefined reference to `main'                                                                                                                
          /usr/bin/ld: /archlinux/build/glibc/src/glibc-2.35/csu/../sysdeps/loongarch/start.S:49: undefined reference to `main'                                                                                                                
          /usr/bin/ld: /usr/lib/gcc/loongarch64-unknown-linux-gnu/12.0.1/../../../../lib64/Scrt1.o:/archlinux/build/glibc/src/glibc-2.35/csu/../sysdeps/loongarch/start.S:49: more undefined references to `main' follow                       
          collect2: error: ld returned 1 exit status                                                                                                                                                                                           
                                                    
  = help: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified                                                                                                               
  = note: use the `-l` flag to specify native libraries to link                                                                                                                                                                                
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)                                           
                                                                                                                                                                                                                                               
error: could not compile `proc-macro2` due to previous error

这个情况感觉跟 aarch64 上这个注释说的情况很像:

#if defined PIC && !defined SHARED
/* When main is not defined in the executable but in a shared library
then a wrapper is needed in crt1.o of the static-pie enabled libc,
because crt1.o and rcrt1.o share code and the later must avoid the
use of GOT relocations before __libc_start_main is called. */
__wrap_main:
BTI_C
b main
#endif

系统中使用的 gcc 确实也启用了--enable-static-pie

$ gcc -v
使用内建 specs。
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/loongarch64-unknown-linux-gnu/12.0.1/lto-wrapper
目标:loongarch64-unknown-linux-gnu
配置为:/archlinux/build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,lto,objc,obj-c++ --with-isl --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-static-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-install-libiberty --enable-linker-build-id --enable-lto --disable-multiarch --enable-plugin --enable-shared --enable-threads=posix --enable-libssp --disable-libstdcxx-pch --disable-libunwind-exceptions --enable-link-serialization=1 --enable-tls --disable-werror
线程模型:posix
Supported LTO compression algorithms: zlib zstd
gcc 版本 12.0.1 20220317 (experimental) (GCC) 

请确认这是否是个 bug,谢谢

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.