<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/lib/csu/i386-elf, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=main</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2015-05-19T21:00:53Z</updated>
<entry>
<title>All FreeBSD platforms are elf: move i386-elf to i386</title>
<updated>2015-05-19T21:00:53Z</updated>
<author>
<name>Ed Maste</name>
<email>emaste@FreeBSD.org</email>
</author>
<published>2015-05-19T21:00:53Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=302af79506e7c238ed59fe8bc2270b11501ffb3d'/>
<id>urn:sha1:302af79506e7c238ed59fe8bc2270b11501ffb3d</id>
<content type='text'>
This was a leftover from when we had both i386 a.out and ELF.

Reviewed by:	kib, imp
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D2591
</content>
</entry>
<entry>
<title>Ensure the cross assembler, linker and objcopy are used for the build32</title>
<updated>2015-04-02T06:58:17Z</updated>
<author>
<name>Dimitry Andric</name>
<email>dim@FreeBSD.org</email>
</author>
<published>2015-04-02T06:58:17Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=76e2c537bc4dfec23159f4f7a20cdc6621f41414'/>
<id>urn:sha1:76e2c537bc4dfec23159f4f7a20cdc6621f41414</id>
<content type='text'>
stage, just like for the regular world stage.

Reviewed by:	rodrigc, imp, bapt, emaste
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D2187
</content>
</entry>
<entry>
<title>Use bsd.lib.mk here as all other csu Makefiles do.</title>
<updated>2014-08-19T15:30:56Z</updated>
<author>
<name>Bryan Drewery</name>
<email>bdrewery@FreeBSD.org</email>
</author>
<published>2014-08-19T15:30:56Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=6855730b5c8e2f08fa6e7a7d291f1ea4eb48554e'/>
<id>urn:sha1:6855730b5c8e2f08fa6e7a7d291f1ea4eb48554e</id>
<content type='text'>
This effectively reverts r124752.

There's no reason this should be different. It resulted in needing NO_PIE in
the original opt-out NO_PIE commit as this was not using the proper framework.

Reported by:	peter
</content>
</entry>
<entry>
<title>Revert r267233 for now. PIE support needs to be reworked.</title>
<updated>2014-08-19T15:04:32Z</updated>
<author>
<name>Bryan Drewery</name>
<email>bdrewery@FreeBSD.org</email>
</author>
<published>2014-08-19T15:04:32Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=5608fd23c27fa1e8ee595d7b678cbfd35d657fbe'/>
<id>urn:sha1:5608fd23c27fa1e8ee595d7b678cbfd35d657fbe</id>
<content type='text'>
1. 50+% of NO_PIE use is fixed by adding -fPIC to INTERNALLIB and other
   build-only utility libraries.
2. Another 40% is fixed by generating _pic.a variants of various libraries.
3. Some of the NO_PIE use is a bit absurd as it is disabling PIE (and ASLR)
   where it never would work anyhow, such as csu or loader. This suggests
   there may be better ways of adding support to the tree. Many of these
   cases can be fixed such that -fPIE will work but there is really no
   reason to have it in those cases.
4. Some of the uses are working around hacks done to some Makefiles that are
   really building libraries but have been using bsd.prog.mk because the code
   is cleaner. Had they been using bsd.lib.mk then NO_PIE would not have
   been needed.

We likely do want to enable PIE by default (opt-out) for non-tree consumers
(such as ports). For in-tree though we probably want to only enable PIE
(opt-in) for common attack targets such as remote service daemons and setuid
utilities. This is also a great performance compromise since ASLR is expected
to reduce performance. As such it does not make sense to enable it in all
utilities such as ls(1) that have little benefit to having it enabled.

Reported by:	kib
</content>
</entry>
<entry>
<title>Reviewed by: imp</title>
<updated>2014-07-26T04:38:09Z</updated>
<author>
<name>Simon J. Gerraty</name>
<email>sjg@FreeBSD.org</email>
</author>
<published>2014-07-26T04:38:09Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=5b6dc2efc9b2891767cd28d71ac3ed4878b0ddbb'/>
<id>urn:sha1:5b6dc2efc9b2891767cd28d71ac3ed4878b0ddbb</id>
<content type='text'>
LDFLAGS is supposed to be given to CC not LD.
Define _LDFLAGS as a filtered version of LDFLAGS safe to give to LD
</content>
</entry>
<entry>
<title>In preparation for ASLR [1] support add WITH_PIE to support building with -fPIE.</title>
<updated>2014-06-08T17:29:31Z</updated>
<author>
<name>Bryan Drewery</name>
<email>bdrewery@FreeBSD.org</email>
</author>
<published>2014-06-08T17:29:31Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=864c53ead899f7838cd2e1cca3b485a4a82f5cdc'/>
<id>urn:sha1:864c53ead899f7838cd2e1cca3b485a4a82f5cdc</id>
<content type='text'>
This is currently an opt-in build flag. Once ASLR support is ready and stable
it should changed to opt-out and be enabled by default along with ASLR.

Each application Makefile uses opt-out to ensure that ASLR will be enabled by
default in new directories when the system is compiled with PIE/ASLR. [2]

Mark known build failures as NO_PIE for now.

The only known runtime failure was rtld.

[1] http://www.bsdcan.org/2014/schedule/events/452.en.html
Submitted by:		Shawn Webb &lt;lattera@gmail.com&gt;
Discussed between:	des@ and Shawn Webb [2]
</content>
</entry>
<entry>
<title>Only assign the environ in the startup code when environ is NULL.</title>
<updated>2013-01-07T17:58:27Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2013-01-07T17:58:27Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=d549ead6a9b96936cf23dd4672fe926a0cd9ddeb'/>
<id>urn:sha1:d549ead6a9b96936cf23dd4672fe926a0cd9ddeb</id>
<content type='text'>
Preloaded library could have changed the environment, and
unconditional assingment to the environ undoes the customization.
The binaries needs to be recompiled to get the fix.

Move the common code to set up environ and __progname into the helper.
Note that ia64 possibly not fixed, due to it still using old csu.

Reported and tested by:	John Hein &lt;jhein@symmetricom.com&gt;
Reviewed by:	kan, scf
Approved by:	secteam (simon)
MFC after:	2 weeks
</content>
</entry>
<entry>
<title>After r217375, some startup objects under lib/csu are built in a special</title>
<updated>2012-04-20T21:00:39Z</updated>
<author>
<name>Dimitry Andric</name>
<email>dim@FreeBSD.org</email>
</author>
<published>2012-04-20T21:00:39Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=d2cc835cb5cec80295ee4234f5562e65d48368fd'/>
<id>urn:sha1:d2cc835cb5cec80295ee4234f5562e65d48368fd</id>
<content type='text'>
way: first they are compiled to assembly, then some sed'ing is done on
the assembly, and lastly the assembly is compiled to an object file.

This last step is done using ${CC}, and not ${AS}, because when the
compiler is clang, it outputs directives that are too advanced for our
old gas.  So we use clang's integrated assembler instead.  (When the
compiler is gcc, it just calls gas, and nothing is different, except one
extra fork.)

However, in the .s to .o rules in lib/csu/$ARCH/Makefile, I still passed
CFLAGS to the compiler, instead of ACFLAGS, which are specifically for
compiling .s files.

In case you are using '-g' for debug info anywhere in your CFLAGS, it
causes the .s files to already contain debug information in the assembly
itself.  In the next step, the .s files are also compiled using '-g',
and if the compiler is clang, it complains: "error: input can't have
.file dwarf directives when -g is used to generate dwarf debug info for
assembly code".

Fix this by using ${ACFLAGS} for compiling the .s files instead.

Reported by:	jasone
MFC after:	1 week
</content>
</entry>
<entry>
<title>Stop calling _init/_fini methods from crt1 for dynamic binaries.  Do</title>
<updated>2012-03-11T20:04:09Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2012-03-11T20:04:09Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=a22748dbd9f365c8a5f0483a973c2295b245b94c'/>
<id>urn:sha1:a22748dbd9f365c8a5f0483a973c2295b245b94c</id>
<content type='text'>
call preinit, init and fini arrays methods from crt1 for static binaries.

Mark new crt1 with FreeBSD-specific ELF note.

Move some common crt1 code into new MI file ignore_init.c, to reduce
duplication.  Also, conservatively adjust nearby sources for style.

Reviewed by:	kan
Tested by:	andrew (arm), flo (sparc64)
MFC after:	3 weeks
</content>
</entry>
<entry>
<title>The (%esp &amp; 0xf) == 0 should be true before the call instruction is</title>
<updated>2011-01-13T23:00:22Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2011-01-13T23:00:22Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=ea40bc90e19141f8026a95235ba160ffe625e468'/>
<id>urn:sha1:ea40bc90e19141f8026a95235ba160ffe625e468</id>
<content type='text'>
executed, for the properly aligned stack.

Reported and tested by:	rstone
Pointy hat to:	kib
MFC after:	3 days
</content>
</entry>
</feed>
