aboutsummaryrefslogtreecommitdiffstats
path: root/packages/glibc/glibc_2.3.3+cvs20041128.bb
blob: ca25c2955c1efd65685e27317f66f41c0aea8177 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
DESCRIPTION = "GNU C Library"
HOMEPAGE = "http://www.gnu.org/software/libc/libc.html"
LICENSE = "LGPL"
SECTION = "libs"
PRIORITY = "required"
MAINTAINER = "Phil Blundell <pb@handhelds.org>"

DEFAULT_PREFERENCE_sh3 = "-99"

FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/glibc-cvs"
PR = "r3"

GLIBC_ADDONS ?= "linuxthreads"
GLIBC_EXTRA_OECONF ?= ""

DEFAULT_PREFERENCE = "-1"
DEFAULT_PREFERENCE_i686 = "0"
DEFAULT_PREFERENCE_sh3 = "0"
DEFAULT_PREFERENCE_sh4 = "0"

#
# For now, we will skip building of a gcc package if it is a uclibc one
# and our build is not a uclibc one, and we skip a glibc one if our build
# is a uclibc build.
#
# See the note in gcc/gcc_3.4.0.oe
#

python __anonymous () {
    import bb, re
    uc_os = (re.match('.*uclibc$', bb.data.getVar('TARGET_OS', d, 1)) != None)
    if uc_os:
        raise bb.parse.SkipPackage("incompatible with target %s" %
                                   bb.data.getVar('TARGET_OS', d, 1))
}

# nptl needs unwind support in gcc, which can't be built without glibc.
PROVIDES = "virtual/libc ${@['virtual/${TARGET_PREFIX}libc-for-gcc', '']['nptl' in '${GLIBC_ADDONS}']}"
PROVIDES += "virtual/libintl virtual/libiconv"
DEPENDS = "${@['virtual/${TARGET_PREFIX}gcc-initial', 'virtual/${TARGET_PREFIX}gcc']['nptl' in '${GLIBC_ADDONS}']} linux-libc-headers"
INHIBIT_DEFAULT_DEPS = "1"

#	   file://noinfo.patch;patch=1
#	   file://ldconfig.patch;patch=1;pnum=0
SRC_URI = "cvs://anoncvs@sources.redhat.com/cvs/glibc;module=libc;date=${@bb.data.getVar('PV', d, 1)[9:]} \
	   file://arm-ioperm.patch;patch=1;pnum=0 \
	   file://ldd.patch;patch=1;pnum=0 \
	   file://fhs-linux-paths.patch;patch=1 \
	   file://arm-no-hwcap.patch;patch=1;pnum=0 \
	   file://arm-memcpy.patch;patch=1;pnum=0 \
	   file://arm-longlong.patch;patch=1;pnum=0 \
	   file://arm-machine-gmon.patch;patch=1;pnum=0 \
	   \
           file://etc/ld.so.conf \
	   file://generate-supported.mk"

# seems to fail on tls platforms
SRC_URI_append_arm = " file://dyn-ldconfig-20041128.patch;patch=1"

SRC_URI_append_openmn = " file://ldsocache-varrun.patch;patch=1"

S = "${WORKDIR}/libc"
B = "${WORKDIR}/build-${TARGET_SYS}"

inherit autotools

EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
	        --without-cvs --disable-profile --disable-debug --without-gd \
		--enable-clocale=gnu \
	        --enable-add-ons=${GLIBC_ADDONS} \
		--with-headers=${CROSS_DIR}/${TARGET_SYS}/include \
		--without-selinux \
		${GLIBC_EXTRA_OECONF}"

EXTRA_OECONF += "${@get_glibc_fpu_setting(bb, d)}"

def get_glibc_fpu_setting(bb, d):
	if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]:
		return "--without-fp"
	return ""

do_configure () {
# override this function to avoid the autoconf/automake/aclocal/autoheader
# calls for now
# don't pass CPPFLAGS into configure, since it upsets the kernel-headers
# version check and doesn't really help with anything
	if [ -z "`which rpcgen`" ]; then
		echo "rpcgen not found.  Install glibc-devel."
		exit 1
	fi
	(cd ${S} && gnu-configize) || die "failure in running gnu-configize"
	CPPFLAGS="" oe_runconf
}

rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
	  yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
	  rusers.x spray.x nfs_prot.x rquota.x key_prot.x"

do_compile () {
	# this really is arm specific
	touch ${S}/sysdeps/arm/framestate.c
	# -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
	unset LDFLAGS
	base_do_compile
	(
		cd ${S}/sunrpc/rpcsvc
		for r in ${rpcsvc}; do
			h=`echo $r|sed -e's,\.x$,.h,'`
			rpcgen -h $r -o $h || oewarn "unable to generate header for $r"
		done
	)
}

do_stage() {
	rm -f ${STAGING_LIBDIR}/libc.so.6
	oe_runmake 'install_root=${STAGING_DIR}/${HOST_SYS}' \
		   'includedir=/include' 'libdir=/lib' 'slibdir=/lib' \
		   '${STAGING_LIBDIR}/libc.so.6' \
		   install-headers install-lib

	install -d ${STAGING_INCDIR}/gnu \
		   ${STAGING_INCDIR}/bits \
		   ${STAGING_INCDIR}/rpcsvc
	install -m 0644 ${S}/include/gnu/stubs.h ${STAGING_INCDIR}/gnu/
	install -m 0644 ${B}/bits/stdio_lim.h ${STAGING_INCDIR}/bits/
	install -m 0644 misc/syscall-list.h ${STAGING_INCDIR}/bits/syscall.h
	for r in ${rpcsvc}; do
		h=`echo $r|sed -e's,\.x$,.h,'`
		install -m 0644 ${S}/sunrpc/rpcsvc/$h ${STAGING_INCDIR}/rpcsvc/
	done
	for i in libc.a libc_pic.a libc_nonshared.a; do
		install -m 0644 ${B}/$i ${STAGING_LIBDIR}/ || die "failed to install $i"
	done
	echo 'GROUP ( libpthread.so.0 libpthread_nonshared.a )' > ${STAGING_LIBDIR}/libpthread.so
	echo 'GROUP ( libc.so.6 libc_nonshared.a )' > ${STAGING_LIBDIR}/libc.so

	rm -f ${CROSS_DIR}/${TARGET_SYS}/lib/libc.so.6
	oe_runmake 'install_root=${CROSS_DIR}/${TARGET_SYS}' \
		   'includedir=/include' 'libdir=/lib' 'slibdir=/lib' \
		   '${CROSS_DIR}/${TARGET_SYS}/lib/libc.so.6' \
		   install-headers install-lib

	install -d ${CROSS_DIR}/${TARGET_SYS}/include/gnu \
		   ${CROSS_DIR}/${TARGET_SYS}/include/bits \
		   ${CROSS_DIR}/${TARGET_SYS}/include/rpcsvc
	install -m 0644 ${S}/include/gnu/stubs.h ${CROSS_DIR}/${TARGET_SYS}/include/gnu/
	install -m 0644 ${B}/bits/stdio_lim.h ${CROSS_DIR}/${TARGET_SYS}/include/bits/
	install -m 0644 misc/syscall-list.h ${CROSS_DIR}/${TARGET_SYS}/include/bits/syscall.h
	for r in ${rpcsvc}; do
		h=`echo $r|sed -e's,\.x$,.h,'`
		install -m 0644 ${S}/sunrpc/rpcsvc/$h ${CROSS_DIR}/${TARGET_SYS}/include/rpcsvc/
	done

	for i in libc.a libc_pic.a libc_nonshared.a; do
		install -m 0644 ${B}/$i ${CROSS_DIR}/${TARGET_SYS}/lib/ || die "failed to install $i"
	done
	echo 'GROUP ( libpthread.so.0 libpthread_nonshared.a )' > ${CROSS_DIR}/${TARGET_SYS}/lib/libpthread.so
	echo 'GROUP ( libc.so.6 libc_nonshared.a )' > ${CROSS_DIR}/${TARGET_SYS}/lib/libc.so
}

include glibc-package.bbclass
/span>"virgl gtk test must be run inside a X session") distro = oe.lsb.distro_identifier() if distro and distro == 'debian-8': self.skipTest('virgl isn\'t working with Debian 8') if distro and distro == 'debian-9': self.skipTest('virgl isn\'t working with Debian 9') if distro and distro == 'centos-7': self.skipTest('virgl isn\'t working with Centos 7') if distro and distro == 'opensuseleap-15.0': self.skipTest('virgl isn\'t working with Opensuse 15.0') qemu_packageconfig = get_bb_var('PACKAGECONFIG', 'qemu-system-native') qemu_distrofeatures = get_bb_var('DISTRO_FEATURES', 'qemu-system-native') features = 'INHERIT += "testimage"\n' if 'gtk+' not in qemu_packageconfig: features += 'PACKAGECONFIG:append:pn-qemu-system-native = " gtk+"\n' if 'sdl' not in qemu_packageconfig: features += 'PACKAGECONFIG:append:pn-qemu-system-native = " sdl"\n' if 'opengl' not in qemu_distrofeatures: features += 'DISTRO_FEATURES:append = " opengl"\n' features += 'TEST_SUITES = "ping ssh virgl"\n' features += 'IMAGE_FEATURES:append = " ssh-server-dropbear"\n' features += 'IMAGE_INSTALL:append = " kmscube"\n' features_gtk = features + 'TEST_RUNQEMUPARAMS = "gtk gl"\n' self.write_config(features_gtk) bitbake('core-image-minimal') bitbake('-c testimage core-image-minimal') features_sdl = features + 'TEST_RUNQEMUPARAMS = "sdl gl"\n' self.write_config(features_sdl) bitbake('core-image-minimal') bitbake('-c testimage core-image-minimal') def test_testimage_virgl_headless(self): """ Summary: Check host-assisted accelerate OpenGL functionality in qemu with egl-headless frontend Expected: 1. Check that virgl kernel driver is loaded and 3d acceleration is enabled 2. Check that kmscube demo runs without crashing. Product: oe-core Author: Alexander Kanavin <alex.kanavin@gmail.com> """ import subprocess, os distro = oe.lsb.distro_identifier() if distro and distro in ['debian-9', 'debian-10', 'centos-7', 'centos-8', 'ubuntu-16.04', 'ubuntu-18.04']: self.skipTest('virgl headless cannot be tested with %s' %(distro)) render_hint = """If /dev/dri/renderD* is absent due to lack of suitable GPU, 'modprobe vgem' will create one sutable for mesa llvmpipe sofware renderer.""" try: content = os.listdir("/dev/dri") if len([i for i in content if i.startswith('render')]) == 0: self.fail("No render nodes found in /dev/dri: %s. %s" %(content, render_hint)) except FileNotFoundError: self.fail("/dev/dri directory does not exist; no render nodes available on this machine. %s" %(render_hint)) try: dripath = subprocess.check_output("pkg-config --variable=dridriverdir dri", shell=True) except subprocess.CalledProcessError as e: self.fail("Could not determine the path to dri drivers on the host via pkg-config.\nPlease install Mesa development files (particularly, dri.pc) on the host machine.") qemu_distrofeatures = get_bb_var('DISTRO_FEATURES', 'qemu-system-native') features = 'INHERIT += "testimage"\n' if 'opengl' not in qemu_distrofeatures: features += 'DISTRO_FEATURES:append = " opengl"\n' features += 'TEST_SUITES = "ping ssh virgl"\n' features += 'IMAGE_FEATURES:append = " ssh-server-dropbear"\n' features += 'IMAGE_INSTALL:append = " kmscube"\n' features += 'TEST_RUNQEMUPARAMS = "egl-headless"\n' self.write_config(features) bitbake('core-image-minimal') bitbake('-c testimage core-image-minimal') class Postinst(OESelftestTestCase): def init_manager_loop(self, init_manager): import oe.path vars = get_bb_vars(("IMAGE_ROOTFS", "sysconfdir"), "core-image-minimal") rootfs = vars["IMAGE_ROOTFS"] self.assertIsNotNone(rootfs) sysconfdir = vars["sysconfdir"] self.assertIsNotNone(sysconfdir) # Need to use oe.path here as sysconfdir starts with / hosttestdir = oe.path.join(rootfs, sysconfdir, "postinst-test") targettestdir = os.path.join(sysconfdir, "postinst-test") for classes in ("package_rpm", "package_deb", "package_ipk"): with self.subTest(init_manager=init_manager, package_class=classes): features = 'CORE_IMAGE_EXTRA_INSTALL = "postinst-delayed-b"\n' features += 'IMAGE_FEATURES += "package-management empty-root-password"\n' features += 'PACKAGE_CLASSES = "%s"\n' % classes if init_manager == "systemd": features += 'DISTRO_FEATURES:append = " systemd"\n' features += 'VIRTUAL-RUNTIME_init_manager = "systemd"\n' features += 'DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"\n' features += 'VIRTUAL-RUNTIME_initscripts = ""\n' self.write_config(features) bitbake('core-image-minimal') self.assertTrue(os.path.isfile(os.path.join(hosttestdir, "rootfs")), "rootfs state file was not created") with runqemu('core-image-minimal') as qemu: # Make the test echo a string and search for that as # run_serial()'s status code is useless.' for filename in ("rootfs", "delayed-a", "delayed-b"): status, output = qemu.run_serial("test -f %s && echo found" % os.path.join(targettestdir, filename)) self.assertIn("found", output, "%s was not present on boot" % filename) @skipIfNotQemu('qemuall', 'Test only runs in qemu') def test_postinst_rootfs_and_boot_sysvinit(self): """ Summary: The purpose of this test case is to verify Post-installation scripts are called when rootfs is created and also test that script can be delayed to run at first boot. Dependencies: NA Steps: 1. Add proper configuration to local.conf file 2. Build a "core-image-minimal" image 3. Verify that file created by postinst_rootfs recipe is present on rootfs dir. 4. Boot the image created on qemu and verify that the file created by postinst_boot recipe is present on image. Expected: The files are successfully created during rootfs and boot time for 3 different package managers: rpm,ipk,deb and for initialization managers: sysvinit. """ self.init_manager_loop("sysvinit") @skipIfNotQemu('qemuall', 'Test only runs in qemu') def test_postinst_rootfs_and_boot_systemd(self): """ Summary: The purpose of this test case is to verify Post-installation scripts are called when rootfs is created and also test that script can be delayed to run at first boot. Dependencies: NA Steps: 1. Add proper configuration to local.conf file 2. Build a "core-image-minimal" image 3. Verify that file created by postinst_rootfs recipe is present on rootfs dir. 4. Boot the image created on qemu and verify that the file created by postinst_boot recipe is present on image. Expected: The files are successfully created during rootfs and boot time for 3 different package managers: rpm,ipk,deb and for initialization managers: systemd. """ self.init_manager_loop("systemd") def test_failing_postinst(self): """ Summary: The purpose of this test case is to verify that post-installation scripts that contain errors are properly reported. Expected: The scriptlet failure is properly reported. The file that is created after the error in the scriptlet is not present. Product: oe-core Author: Alexander Kanavin <alex.kanavin@gmail.com> """ import oe.path vars = get_bb_vars(("IMAGE_ROOTFS", "sysconfdir"), "core-image-minimal") rootfs = vars["IMAGE_ROOTFS"] self.assertIsNotNone(rootfs) sysconfdir = vars["sysconfdir"] self.assertIsNotNone(sysconfdir) # Need to use oe.path here as sysconfdir starts with / hosttestdir = oe.path.join(rootfs, sysconfdir, "postinst-test") for classes in ("package_rpm", "package_deb", "package_ipk"): with self.subTest(package_class=classes): features = 'CORE_IMAGE_EXTRA_INSTALL = "postinst-rootfs-failing"\n' features += 'PACKAGE_CLASSES = "%s"\n' % classes self.write_config(features) bb_result = bitbake('core-image-minimal', ignore_status=True) self.assertGreaterEqual(bb_result.output.find("Postinstall scriptlets of ['postinst-rootfs-failing'] have failed."), 0, "Warning about a failed scriptlet not found in bitbake output: %s" %(bb_result.output)) self.assertTrue(os.path.isfile(os.path.join(hosttestdir, "rootfs-before-failure")), "rootfs-before-failure file was not created") self.assertFalse(os.path.isfile(os.path.join(hosttestdir, "rootfs-after-failure")), "rootfs-after-failure file was created") class SystemTap(OESelftestTestCase): """ Summary: The purpose of this test case is to verify native crosstap works while talking to a target. Expected: The script should successfully connect to the qemu machine and run some systemtap examples on a qemu machine. """ @classmethod def setUpClass(cls): super(SystemTap, cls).setUpClass() cls.image = "core-image-minimal" def default_config(self): return """ # These aren't the actual IP addresses but testexport class needs something defined TEST_SERVER_IP = "192.168.7.1" TEST_TARGET_IP = "192.168.7.2" EXTRA_IMAGE_FEATURES += "tools-profile dbg-pkgs" IMAGE_FEATURES:append = " ssh-server-dropbear" # enables kernel debug symbols KERNEL_EXTRA_FEATURES:append = " features/debug/debug-kernel.scc" KERNEL_EXTRA_FEATURES:append = " features/systemtap/systemtap.scc" # add systemtap run-time into target image if it is not there yet IMAGE_INSTALL:append = " systemtap-runtime" """ def test_crosstap_helloworld(self): self.write_config(self.default_config()) bitbake('systemtap-native') systemtap_examples = os.path.join(get_bb_var("WORKDIR","systemtap-native"), "usr/share/systemtap/examples") bitbake(self.image) with runqemu(self.image) as qemu: cmd = "crosstap -r root@192.168.7.2 -s %s/general/helloworld.stp " % systemtap_examples result = runCmd(cmd) self.assertEqual(0, result.status, 'crosstap helloworld returned a non 0 status:%s' % result.output) def test_crosstap_pstree(self): self.write_config(self.default_config()) bitbake('systemtap-native') systemtap_examples = os.path.join(get_bb_var("WORKDIR","systemtap-native"), "usr/share/systemtap/examples") bitbake(self.image) with runqemu(self.image) as qemu: cmd = "crosstap -r root@192.168.7.2 -s %s/process/pstree.stp" % systemtap_examples result = runCmd(cmd) self.assertEqual(0, result.status, 'crosstap pstree returned a non 0 status:%s' % result.output) def test_crosstap_syscalls_by_proc(self): self.write_config(self.default_config()) bitbake('systemtap-native') systemtap_examples = os.path.join(get_bb_var("WORKDIR","systemtap-native"), "usr/share/systemtap/examples") bitbake(self.image) with runqemu(self.image) as qemu: cmd = "crosstap -r root@192.168.7.2 -s %s/process/ syscalls_by_proc.stp" % systemtap_examples result = runCmd(cmd) self.assertEqual(0, result.status, 'crosstap syscalls_by_proc returned a non 0 status:%s' % result.output) def test_crosstap_syscalls_by_pid(self): self.write_config(self.default_config()) bitbake('systemtap-native') systemtap_examples = os.path.join(get_bb_var("WORKDIR","systemtap-native"), "usr/share/systemtap/examples") bitbake(self.image) with runqemu(self.image) as qemu: cmd = "crosstap -r root@192.168.7.2 -s %s/process/ syscalls_by_pid.stp" % systemtap_examples result = runCmd(cmd) self.assertEqual(0, result.status, 'crosstap syscalls_by_pid returned a non 0 status:%s' % result.output)