Bug#787063: klibc: FTBFS with clang instead of gcc

2020-08-20 Thread Ben Hutchings
Control: tag -1 - upstream wontfix

On Thu, 28 May 2015 18:13:02 +0800 Joseph Lee  wrote:
> Hello,
> 
> I was trying to rebuild klibc with clang, not use it as libc. It failed
> because clang can not find some header files when building. I tried to fix
> this by add something in makefile.
> 
> And because of libklibc is needed by Debian to boot, I need to rebuild it
> to produce a bootable Debian.

As of version 2.0.8, it is possible to build klibc with Clang on at
least some architectures.  I don't what is the recommended way to build
Debian packages with a non-default compiler, so I haven't tested
whether that will now work.

If you still care about this, and changes are needed in the Debian
package, I am open to considering a patch.

Ben.

-- 
Ben Hutchings
Logic doesn't apply to the real world. - Marvin Minsky




signature.asc
Description: This is a digitally signed message part


Bug#787063: klibc: FTBFS with clang instead of gcc

2015-05-28 Thread Thorsten Glaser
Joseph Lee dixit:

>I was trying to rebuild klibc with clang, not use it as libc. It failed

Yes, and exactly that is (probably; not speaking for upstream, just from
what I learned using and hacking and fixing it) not possible, and it’s
not unreasonable to disallow it.

bye,
//mirabilos
-- 
 exceptions: a truly awful implementation of quite a nice idea.
 just about the worst way you could do something like that, afaic.
 it's like anti-design.   that too… may I quote you on that?
 sure, tho i doubt anyone will listen ;)


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#787063: klibc: FTBFS with clang instead of gcc

2015-05-28 Thread Joseph Lee
Hello,

I was trying to rebuild klibc with clang, not use it as libc. It failed
because clang can not find some header files when building. I tried to fix
this by add something in makefile.

And because of libklibc is needed by Debian to boot, I need to rebuild it
to produce a bootable Debian.

Many thanks,
Joseph

2015-05-28 17:38 GMT+08:00 Thorsten Glaser :

> Joseph Lee dixit:
>
> >Using the rebuilding infrastructure, your package failed to build with
> >clang instead of gcc.
>
> I think this is by design (upstream); klibc is sorta an embedded C
> library and for example does not honour the standard ELF i386 psABI
> for better performance and code size.
>
> bye,
> //mirabilos
> --
>  exceptions: a truly awful implementation of quite a nice idea.
>  just about the worst way you could do something like that, afaic.
>  it's like anti-design.   that too… may I quote you on
> that?
>  sure, tho i doubt anyone will listen ;)
>


Bug#787063: klibc: FTBFS with clang instead of gcc

2015-05-28 Thread Thorsten Glaser
Joseph Lee dixit:

>Using the rebuilding infrastructure, your package failed to build with
>clang instead of gcc.

I think this is by design (upstream); klibc is sorta an embedded C
library and for example does not honour the standard ELF i386 psABI
for better performance and code size.

bye,
//mirabilos
-- 
 exceptions: a truly awful implementation of quite a nice idea.
 just about the worst way you could do something like that, afaic.
 it's like anti-design.   that too… may I quote you on that?
 sure, tho i doubt anyone will listen ;)


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#787063: klibc: FTBFS with clang instead of gcc

2015-05-28 Thread Joseph Lee
Source: klibc
Version: 2.0.4
Severity: minor

Dear Maintainer,

Hello,

Using the rebuilding infrastructure, your package failed to build with clang 
instead of gcc. 

Error is like this:
http://clang.debian.net/status.php?version=3.6.0&key=FILE_NOT_FOUND

Full build log is available here:
http://clang.debian.net/logs/2015-03-25/klibc_2.0.4-2_unstable_clang.log


Thanks,
Joseph


-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.0.4-2-ARCH (SMP w/8 CPU cores; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -Nru klibc-2.0.4/debian/patches/clang_build.patch klibc-2.0.4/debian/patches/clang_build.patch
--- klibc-2.0.4/debian/patches/clang_build.patch	1970-01-01 00:00:00.0 +
+++ klibc-2.0.4/debian/patches/clang_build.patch	2015-05-24 14:33:14.0 +
@@ -0,0 +1,16 @@
+--- a/scripts/Kbuild.klibc
 b/scripts/Kbuild.klibc
+@@ -118,6 +118,13 @@
+ 		   -I$(KLIBCKERNELOBJ)/include -I$(srctree)/include)\
+ 		 $(KLIBCARCHINCFLAGS)
+ 
++# when building with clang, clang's builtin header files's location is not in the search path.
++ifeq ($(shell $(KLIBCCC) -v 2>&1 | grep -c "clang version"),1)
++  CLANGVERSION:= $(shell $(KLIBCCC) --version 2>&1 | grep "clang version" | sed "s/.*version \([0-9]*\.[0-9]*\).*/\1/")
++  KLIBCCPPFLAGS   += -I/usr/include/clang/$(CLANGVERSION)/include
++endif
++	
++
+ # klibc definitions
+ KLIBCDEFS+= -D__KLIBC__=$(KLIBCMAJOR)  \
+ 		-D__KLIBC_MINOR__=$(KLIBCMINOR)\
diff -Nru klibc-2.0.4/debian/patches/series klibc-2.0.4/debian/patches/series
--- klibc-2.0.4/debian/patches/series	2014-10-05 00:13:46.0 +
+++ klibc-2.0.4/debian/patches/series	2015-05-24 14:29:36.0 +
@@ -9,3 +9,4 @@
 readlink-add-f-option.patch
 mount-implement-o-defaults.patch
 mips-update-archfcntl-h.patch
+clang_build.patch