[haiku-commits] Re: BRANCH jessicah-github.ticket-4028 [60eabe65402d] src/bin/writembr

  • From: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
  • To: "haiku-commits@xxxxxxxxxxxxx" <haiku-commits@xxxxxxxxxxxxx>
  • Date: Mon, 1 Jun 2015 23:43:56 +1200

On 1 June 2015 at 23:37, Adrien Destugues <pulkomandy@xxxxxxxxxxxxx> wrote:

diff --git a/build/jam/images/AnybootImage b/build/jam/images/AnybootImage
index 0c44c1f..9c494a5 100644
--- a/build/jam/images/AnybootImage
+++ b/build/jam/images/AnybootImage
@@ -14,7 +14,7 @@ rule BuildAnybootMBR binary : source {

actions BuildAnybootMBR1 {
$(RM) $(1)
- $(HAIKU_NASM) -f bin $(MBR_SOURCE) -O5 -o $(1)
+ gcc $(MBR_SOURCE) -o $(1) -nostdlib -Xlinker --oformat=binary -Xlinker -S
-Xlinker -N -Xlinker
"-e start" -Xlinker "-Ttext=0x600"
}


-SEARCH on mbr.nasm = [ FDirName $(HAIKU_TOP) src bin writembr ] ;
+actions BuildPartitioningMBR
+{
+ $(RM) $(1)
+ # $(HAIKU_CC) doesn't appear to work here...
+ gcc $(2) -o $(1) -DMBR_CODE_ONLY -nostdlib -Xlinker --oformat=binary
-Xlinker -S -Xlinker -N
-Xlinker "-e start" -Xlinker "-Ttext=0x600"
+}

Does this mean we would be using the host gcc for this? It doesn't sound like
a good idea, as it would prevent building from a non-x86 host. Is there a
reason for not staying with nasm? If so, is there a way to get this working
with the Haiku compiler?

Ah, you replied too quick! No, I just didn't know how to invoke the
compiler correctly, hence one of the reasons to pushing to a branch
for review :-)

Reason for not sticking with nasm is because that's an undertaking I
don't feel qualified to do. And there's not really a compelling reason
to stick with nasm when gcc will do (we used to use gcc/as
previously).

Other related posts: